C
C
camradee2020-05-19 16:44:47
PHP
camradee, 2020-05-19 16:44:47

How to fix session_start(): Session data file is not created by your uid warning?

There is vagrant (apache, php7.2) and custom cms that saves sessions in its own directory.
At startup, [Warning] session_start () occurs: Session data file is not created by your uid
The essence of the problem is that all directories and project files belong to the vagrant user, and this same your uid is www-user. Users vagrant and www-user are in the common group www-data which can do everything, but this does not seem to help. The problem is aggravated by the fact that changing the owner under vagrant does not work - sudo chown -R www-user sessions/ does not work. How can the situation be corrected?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kutuzov_ska, 2020-05-21
@Kutuzov_ska

Only today I suffered with the transfer of joomla to a new vds. session_start() Error....
My actions after a day of struggle. - I had nginx, fedora28.
1. Just try to log in as root in vagrant - `su` password `vagrant`;
2. `cd /path/to/project/...` - go to the project folder, your cms should be there.
3. `chmod -R ugo-rwx cms` - disable all permissions for your folder
4. `chmod -R ug+rwx cms` - give permissions for user and group.
5. `chown -R vagrant:nginx cms` - give the vagrant user and the nginx group permissions
6. Go to `nano /etc/nginx/nginx.conf` - see who we have as user - it should be nginx.
7. Go to `nano /etc/php-fpm.d/www.conf` - Here the directories may differ for php-fpm, but the main thing is to find the `user=apache` and `group=apache` entries there (by default, like this ). We change both here and there apcahe to nginx.
8. `chown -R nginx:nginx /var/lib/php/session` - give permissions to this damn folder...
9. `chown -R ug+rwx /var/lib/php/session`
10. `service nginx restart`
11. `service php-fpm restart`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question