今天在PHP扩展ssh2的时候,重启apache时候,发现报错,网上找了好久资料,一种是关闭selinux,怕安全性问题没这么做,后来又找到了一个解决方案(http://www.linuxforums.org/forum/red-hat-fedora-linux/87975-configuring-php-work-apache.html),如下:

1
2
$ /usr/local/apache2/bin/apachectlstart
httpd: Syntax error on line 203 of /etc/httpd/conf/httpd.conf: Cannot load /usr/lib/httpd/modules/libphp5.so into server: /usr/lib/httpd/modules/libphp5.so: undefined symbol: zend_parse_parameters

解决方法:
首先,安装bison,bison 是替代yacc的语法分析程序生成器。

1
2
3
4
5
6
$ wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
$ tar-zxvf bison-2.5.tar.gz
$ cdbison-2.5
$ ./configure
$ make
$ makeinstall

然后,重新编译php

1
2
$ makeinstalldistclean
$ /usr/local/apache2/bin/apachectlstart