After the new server (CentOS 6.3) compiles and installs the php-5.4.8, and then configures the php.ini and httpd.conf, the command executes/USR/LOCAL/APACHE2/BIN/APACHECTL when the apache-2.4.3 is started When start, Tip:
httpd:syntax error on line 146 Of/etc/httpd/conf/httpd.conf:cannot load/usr/local/apache/modules/libphp5.so int O Server:/usr/local/apache/modules/libphp5.so:undefined symbol:zend_parse_parameters
Found by search, said to be missing bison.
If you find that Bison is not installed by Rpm-qa|grep Bison, install bison. CentOS can be used with Yum install Bison
But I have found that bison-2.4.1 has been installed. Finally, there is no way to download the bison-2.5 RPM package to install directly.
[[email protected]~]# wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz [[email protected]~]# TAR-ZXVF bison-2.5.tar.gz [[email protected]~]# CD bison-2.5 [[email protected]~]#./configure [[email protected]~]# make && make install
And then recompile the PHP installation. Then/usr/local/apache2/bin/apachectl start to launch Apache. The surprise discovery can start normally, test the next PHP Web page, can be accessed normally.
I heard that others will report the following error, I also write it together.
When the command executes/USR/LOCAL/APACHE2/BIN/APACHECTL start, the error message is as follows:
Httpd:syntax error on line 146 Of/usr/local/apache/conf/httpd.conf:cannot load/usr/local/apache/modules/libphp5.so in To server:/usr/local/apache/modules/libphp5.so:cannot Restore segment prot after Reloc:permission denied
This is caused by the SELinux protection mode. There are 2 ways to solve this problem.
First: Permanently turn off SELinux protection mode (not recommended, risk to the server)
[~]#
Change Selinux=enforcing to Selinux=disabled
Save the reboot system.
Second method: Temporarily turn off SELinux mode
[~]# setenforce 0[~]# Chcon-c- V-r-u system_u-r object_r-t textrel_shlib_t/usr/local/apache/modules/libphp5.so
If the above command is an error, you can try this chcon-t texrel_shlib_t/usr/local/apache/modules/libphp5.so
If there are any errors, please use the Help to write the commands according to the help.
[~]# service httpd restart[~]# Setenforce 1
Configure PHP to start Apache service error