• 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!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.

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