• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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