Resource icon

How to resolve Plesk “Syntax error on line 31 of /etc/httpd/conf.d/php.conf”?

Sometimes, when configuring the Plesk, you may get syntax error such as “Syntax error on line 31 of /etc/httpd/conf.d/php.conf”
Using the system package manager from the point of OS repositories, you must process manual PHP system installation:

Code:
tail /var/log/yum.log
Dec 11 02:37:19 Installed: libzip-0.10.1-8.el7.x86_64
Dec 11 02:37:19 Installed: php-common-5.4.16-48.el7.x86_64
Dec 11 02:37:20 Installed: php-cli-5.4.16-48.el7.x86_64
Dec 11 02:37:20 Installed: php-pdo-5.4.16-48.el7.x86_64
Dec 11 02:37:20 Installed: t1lib-5.1.2-14.el7.x86_64
Dec 11 02:37:20 Installed: php-gd-5.4.16-48.el7.x86_64
Dec 11 02:37:20 Installed: php-mysql-5.4.16-48.el7.x86_64
Dec 11 02:37:20 Installed: php-5.4.16-48.el7.x86_64
Dec 11 02:37:20 Installed: php-ldap-5.4.16-48.el7.x86_64
Code:
# history | grep php
yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
When you type the syntax incorrectly, you would get error as:

Code:
# tail -5 /etc/httpd/conf.d/php.conf
# Apache specific PHP configuration options
# those can be override in each configured vhost
#
php_valuesession.save_handler "files"
php_valuesession.save_path "/var/lib/php/session"
Just by adding <IfModule mod_php5.c>, you will get clear with the error immediately.

Let us see the steps to modify those parameters one by one:

Step 1: Use SSH for connecting with the server.
Step 2: Let us start creating the configuration file backup using below command:
Code:
# cp /etc/httpd/conf.d/php.conf{,.orig}
Step 3: Open cp /etc/httpd/conf.d/php.conf{,.orig} and then start adding the tags.

Before making any changes:
Code:
php_valuesession.save_handler "files"
php_valuesession.save_path "/var/lib/php/session"
After making any changes:
Code:
<IfModule mod_php5.c>
php_valuesession.save_handler "files"
php_valuesession.save_path    "/var/lib/php/session"
</IfModule>
Conclusion:
Hereby, we have solved the syntax error /etc/httpd/conf.d/php.conf successfully!
Author
kumkumsharma
Views
3,600
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top