4
votes

This is a screenshot with the error dump: any idea what can be caused of this?

I occassionaly get this error while browsing a website i am developing. Obviously session can't be started but i have no idea how to prevent this error because it occurs randomly (as it seems to me). Any idea how can I prevent this error to occur?

1
Please post some bootstrap code and your configs/application.ini, at least the parts relevant to session handling. - David Weinraub
What is happening is that PHP is trying to do garbage collection on the session files, and for some reason the executing process doesn't have permission to manipulate the directory /var/lib/php5. If session GC is going to be initiated, it happens when you call session_start. See Liyali's link for a fix. - drew010

1 Answers

0
votes

I faced the same error and found the root case that PHP application was developed using PHP 5.6. Later on, I installed PHP 7.2 & trying to run PHP 5.6 application using PHP 7.2. Disabling PHP 7.2 worked for me.

Sharing below commands for reference:

sudo a2dismod php7.2 
sudo a2enmod php5.6 
sudo service apache2 restart 
sudo update-alternatives --set php /usr/bin/php5.6 
sudo update-alternatives --set phar /usr/bin/phar5.6 
sudo update-alternatives --set phar.phar /usr/bin/phar.phar5.6