Httpd – Error Start Apache “php value”

apache-2.2httpd

After updating my vps, I get the follow error:

Failed to start apache :
Starting httpd: 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
[FAILED]

Enable modules on PHP:

[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
ionCube Loader
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
sqlite3
standard
suhosin
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
the ionCube PHP Loader

Line relative to error:

php_value session.save_handler "files"

What does the error mean and how can I fix it?

Best Answer

I recently ran into this exact problem using Plesk 9.5 on CentOS.

I cannot say for sure whether it was caused by an update to Plesk, or not. The customer doesn't think any changes were made recently, but Apache failed to start with this error.

After an assesment of the system to ensure it wasn't due to a breach, I did some troubleshooting and determined that mod_php had been removed from the Apache config. After checking Plesk settings, every vhost on the box was using FastCGI and SuExec.

When using FastCGI and SuExec, you cannot change PHP directives in php.conf (FastCGI) and .htaccess (SuExec).

The customer had originally commented out the offending lines, but this broke session support for everything. The only way I was able to resolve it was to manually add mod_php back to httpd.conf.

Add the following line to the section with the other LoadModule's. Make sure the path (../modules/) matches the rest of the modules in there. Chances are good that it already exists on your system and was simply removed from the config during the update.

bash# vi /etc/httpd/conf/httpd.conf
LoadModule php5_module ../modules/libphp5.so

bash# apachectl restart

This caught me off guard, and I cannot say for sure it is the upgrade that caused the issue or whether this is the best fix. I am open for comment, but highly advise against commenting out the php directives in /etc/httpd/conf.d/php.conf as it will break stuff.

Related Topic