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 to serve R:/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.
[Root@localhost ~]# wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz [root@localhost ~]# TAR-ZXVF bison-2.5.tar.gz [root@localhost ~]# cd bison-2.5 [root@localhost ~]# ./configure [ root@localhost ~]# 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)
[Root@localhost ~]#
Change Selinux=enforcing to Selinux=disabled
Save the reboot system.
Second method: Temporarily turn off SELinux mode
[root@localhost ~]# setenforce 0 [root@localhost ~]# chcon-c-v-r-u system_u-r object_r-t textrel_shlib_t/us R/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.
[Root@localhost ~]# service httpd restart [root@localhost ~]# Setenforce 1