Plesk

Domain on Plesk with WHMCS shows error: The PHP session save path /var/lib/php/session is not writable

Symptoms

Cause

Subscription system user directory for sessions is not created or it is not set in the session.save_path PHP settings.

Resolution

Note: in case there is no WHMCS installed on the same server, refer to the following article: Website hosted in Plesk displayed incorrectly or showing the PHP warning: Failed to read session data: files

It is required to create a special directory for the PHP sessions. It is possible to do it via SSH (for Linux) or via Plesk UI (for both Linux and Windows).

Using Plesk Interface

  1. Log into Plesk.

  2. Open File Manager under Domains > example.com.

  3. Click New and choose Create directory.

  4. Specify some name for the folder in this case we call it phpsessions.

  5. Go to the PHP-Settings under Domains > example.com.

  6. Change the setting session.save_path to the total path of a created folder:

    /var/www/vhosts/example.com/phpsessions


    C:inetpubvhostsexample.comhttpdocsphpsessions

Using SSH

  1. Connect to the server using SSH;

  2. Execute the following commands, instead of example, insert subscription system user name:

    # mkdir -p /home/example/whmcsdata/sessions
    # chmod 1750 /h /home/example/whmcsdata/sessions
    # chown example:psacln /home/example/whmcsdata/sessions

  3. Log into Plesk;

  4. Navigate to Domains > example.com > PHP settings;

  5. Set the following directives, for example (for PHP 7.0) and click OK to apply the change:

    include_path: ":/opt/plesk/php/7.0/share/pear:/home/example/whmcsdata/sessions"
    session.save_path: ":/home/example/whmcsdata/sessions"
    open_basedir: ":{WEBSPACEROOT}{/}{:}{TMP}{/}:/home/example/whmcsdata/sessions"

 

Exit mobile version