• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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