Articles in this section

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

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Apache is in Failed state in Plesk, the following error is displayed in Plesk Home page:

    PLESK_ERROR: New configuration files for the Apache web server were not created due to the errors in configuration templates: AH00526: Syntax error on line 31 of /etc/httpd/conf.d/php.conf: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration.

  • System PHP was installed manually from OS repositories using system package manager:

    # tail /var/log/yum.log
    Nov 11 02:47:19 Installed: libzip-0.10.1-8.el7.x86_64
    Nov 11 02:47:19 Installed: php-common-5.4.16-48.el7.x86_64
    Nov 11 02:47:20 Installed: php-cli-5.4.16-48.el7.x86_64
    Nov 11 02:47:20 Installed: php-pdo-5.4.16-48.el7.x86_64
    Nov 11 02:47:20 Installed: t1lib-5.1.2-14.el7.x86_64
    Nov 11 02:47:20 Installed: php-gd-5.4.16-48.el7.x86_64
    Nov 11 02:47:20 Installed: php-mysql-5.4.16-48.el7.x86_64
    Nov 11 02:47:20 Installed: php-5.4.16-48.el7.x86_64
    Nov 11 02:47:20 Installed: php-ldap-5.4.16-48.el7.x86_64

    # history | grep php
    yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo

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:

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

    AFTER:

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

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.