• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • 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.

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