PHP session save_path directory error and does not exist and how to set the vhost.conf
As you know today every businessman want to have a website for his business and the reason behind it is that today a lot of people are using the internet services, so today if you have a website then you can easily showcase your business service and products to the people around you and also to the people across the globe. And today there are a lot of hosting platforms are available and if you think that for your website there will good and heavy web traffic then choosing dedicated server is one of the best options where it helps you and your business to grow.
And the reason why going with a dedicated server is the best option is that in dedicated server you will be provided with an entire server with the root access to your server and with the help of that you can easily install and run any application, not only that you can also easily manage and handle your website. But today if you are using a dedicated server for your website and if you are looking for information on how to overcome session save path directory error and vhost.conf in your dedicated server then here is the solution. So the session which is supported in PHP is of a way to preserve certain data across subsequent accesses. And using these you can easily build a more customized application for your website. And if you are running PHP as a specific user then using the default configuration (/var/lib/php/session/) does not allow you to run that command. So to fix it you have to run this command- chmod 1777 /var/lib/php/session. And it also possible to fix this on a domain by using a special file called vhost.conf:
Follow these steps to set session save path directory and vhost.conf:
>> First you have to create the new directory to house your session inside your domain directory by running this command-
>> Now you have to use the proper permissions and file ownership-
chown username:bsasevs /var/www/vhosts/system/example.com/tmp && chmod 777 /var/www/vhosts/system/example.com/tmp
>> Once after giving the proper permission you have to create the vhost.conf file in this index /var/www/vhosts/testdemo.com/conf and use this command-
>> Now, include this following line-
php_value session.save_path /var/www/vhosts/system/testdemo.com/tmp
>> Now save the file and run this command to force Plesk to see the changes:
/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=testdemo.com
>> Once everything is done in the right way, now you have to restart your Apache to load the new changes by running this command-
service httpd graceful
>> Now your software should now use the new path for sessions data and your CMS installation should proceed.