I got this error when I changed my index.php file into index.html file and then changed back again to its original index.php file
Can anyone tell me what to do to pre
Create folder "tmp" on your root directory with permission 777 then before start_session,
ini_set('session.save_path', 'tmp');
Done
when using ini_set be sure to set the path '/tmp' rather than just 'tmp' didn't work in my case 'tmp'. just like
ini_set('session.save_path', '/tmp')
Steps to solution
create folder tmp inside of the website root
change permission to 777
sudo chmod -R 777 tmp
enter this line above session_start() in your code
ini_set('session.save_path', '/tmp');
done.