Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied in /var/lib/php/session when trying to run session_start() #7

Open
crittermike opened this issue Jul 27, 2017 · 4 comments

Comments

@crittermike
Copy link

This was uncovered when dropping this docker-compose.yml file into the root of a Grav CMS codebase and running docker-compose up. You end up with this error:

2017-07-27 at 11 07 am

Manually opening up a shell inside the container and running chmod -R 777 /var/lib/php/session fixes it.

@grayside
Copy link
Contributor

It looks like we've configured that session path in https://github.com/phase2/docker-apache-php-base/blob/master/root/etc/confd/templates/www.conf.tmpl#L230, so the next step is to make sure that directory is created and correctly permissioned... which should be done in docker-apache-php-base afterall.

Do some PHP apps attempt to manage this directory if it's missing? If so, could handling it in the image cause conflicts?

@febbraro
Copy link
Member

What user needs to own this? apache? I'd prefer not to open up the permissions entirely... can you try setting the owner/group to apache and see if that does the trick?

@crittermike
Copy link
Author

@febbraro confirmed that it works after running:

[root@497f3e044482 /]# chgrp -R apache /var/lib/php/session
[root@497f3e044482 /]# chown -R apache /var/lib/php/session

Also, just FWIW, just running the chgrp wasn't enough.

@febbraro
Copy link
Member

Interested in trying to PR a script like this for that dir?

https://github.com/phase2/docker-apache-php-base/blob/master/root/etc/fix-attrs.d/01-apache-logs-dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants