• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Issue php session_start() causes website to hang and gateway timeout

morphoice

New Pleskian
Server operating system version
Debian 12
Plesk version and microupdate number
18.0.65 Update #2
I have a new plesk webserver setup with php version 8.2.24 by OS vendor run as FPM application.
php session.save_path is set to /var/lib/php/sessions which exists, however if I just so much as call sesssion_start()
in a php script the site hangs completely, eventually displaying a gateway timeout.What am I doing wrong?
it should be trivial to start a php session.
 
I tried the PHP script below.

Code:
<?php
echo "<pre>";
echo "PHP Version: " . phpversion() . "\n";
echo "Session Save Path: " . ini_get('session.save_path') . "\n";
try {
    if (session_status() !== PHP_SESSION_ACTIVE) {
         session_start();
         echo "Session started successfully.\n";
         $_SESSION['test_session_variable'] = "This is a test session variable.";
         echo "Test session variable set.\n";
         if (isset($_SESSION['test_session_variable'])) {
             echo "Session variable read successfully: " . $_SESSION['test_session_variable'] . "\n";
         }
    } else {
      echo "Session already started.\n";
    }
      $session_id = session_id();
      if(empty($session_id)){
        echo "Session id is blank. This means that we cannot create session files.\n";
      } else {
        echo "Session id: ".$session_id."\n";
      }
} catch (Exception $e) {
    echo "Error starting session: " . $e->getMessage() . "\n";
}
if(session_status() == PHP_SESSION_ACTIVE){
  echo "Session status is active. \n";
} else if (session_status() == PHP_SESSION_NONE){
    echo "Session status is none. \n";
} else if (session_status() == PHP_SESSION_DISABLED){
   echo "Session status is disabled. \n";
}
echo "</pre>";
?>

Even with the INCORRECT session.save_path the script doesn't hangs. Please see if this script the helps you to identify the issue is related to the session.save_path or not.
 
Back
Top