Plesk

All sites are down in Plesk: Syntax error on line 31 of /etc/httpd/conf.d/php.conf: Invalid command ‘php_value’

Symptoms

Cause

php package in OS repositories includes incorrect syntax in /etc/httpd/conf.d/php.conf: php_value parameters are included without <IfModule mod_php5.c> tags:

# tail -5 /etc/httpd/conf.d/php.conf
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_value session.save_handler "files"
php_value session.save_path "/var/lib/php/session"

Resolution

  1. Connect to the server via SSH
  2. Create a backup of the configuration file:

    # cp /etc/httpd/conf.d/php.conf{,.orig}

  3. Edit /etc/httpd/conf.d/php.conffile in any text editor and edit the syntax to include the <IfModule mod_php5.c> tags:
    BEFORE:

    php_value session.save_handler "files"
    php_value session.save_path "/var/lib/php/session"

    AFTER:

    <IfModule mod_php5.c>
    php_value session.save_handler "files"
    php_value session.save_path    "/var/lib/php/session"
    </IfModule>

Exit mobile version