• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

CageFS + php /var/lib/php/session/ + Custom php.ini

Andriy_Martynyuk

New Pleskian
Hi ppl,
while using the code similar to:
PHP:
<?php
// Start the session
session_start();
?>
<!DOCTYPE html>
<html>
<body>

<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
?>

<br>

<?php
// Echo session variables that were set on previous page
echo "Favorite color is " . $_SESSION["favcolor"] . ".<br>";
echo "Favorite animal is " . $_SESSION["favanimal"] . ".";
?>

</body>
</html>
We get error:
Code:
Warning: session_start(): open(/var/lib/php/session/sess_n02m5jb0ipntqj3pvn14hebfg6, O_RDWR) failed: No such file or directory (2) in /DATA/www/<domain>/httpdocs/login/check_login.php on line 7 Notice: Undefined index: currentPage in /DATA/www/<domain>/httpdocs/login/check_login.php on line 48 Warning: Unknown: open(/var/lib/php/session/sess_n02m5jb0ipntqj3pvn14hebfg6, O_RDWR) failed: No suc h file or directory (2) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0
The error appears until we disable CageFS for this domain.

So we try to set a "session.save_path" variable wia plesk admin but php_info still shows session.save_path is (/var/lib/php/session). Will provide any additional info necessary.

Please help.
 
Hello Andriy,

You seem to run PHP as an Apache module and not as CGI or FastCGI. This is why the settings are not taking effect..
To make changes with PHP as an Apache module, you will need to edit the file
Code:
/etc/httpd/conf/httpd.conf
and the restart the webserver.

Hope that helps ...
 
Ok, I think I found the issue, it seems it's cloudlinux issue:
when cagefs is enabled the site has no access to "/DATA/www/system/<domain>/etc/php.ini" so uses default /etc/php.ini
That causes the wrong session folder used.
But strange why not using /DATA/www/<domain>/etc/php.ini or /DATA/www/<domain>/conf/php.ini as it is instructed in manuals

Maybe someone knows how to fix?
 
Last edited:
Back
Top