繁体   English   中英

PHP已编译,但phpinfo()显示旧版本

[英]PHP Compiled but phpinfo() Shows Old Version

我试图在CentOS上将PHP从5.2升级到5.3,但是phpinfo()仍然声称已安装PHP 5.2。

通过编译Apache 1.3然后使用apxs构建PHP来构建PHP:

# cd ../php-5.3.29
# ./configure --with-apxs=/usr/local/apache-php/bin/apxs --with-mysql=/usr/include/mysql --with-gd --with-jpeg-dir --with-png-dir --enable-mbstring --with-mysqli --with-pdo-mysql --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl=/usr
# make
# make test
# make install

这似乎有效。 我重新启动了整个服务器,然后像这样启动了Apache:

/usr/local/apache-php/bin/httpd -f /path/to/httpd.conf -D PERLDB -DSSL

Apache正在工作,并且Apache模块服务器状态返回的Apache的构建日期为2014年9月16日,这是正确的。 但是,phpinfo()显示如下:

PHP Version 5.2.6
Build Date Mar 6 2014
Configure Command './configure' '--with-apxs=/usr/local/apache-centosssl-php/bin/apxs' '--with-mysql=/usr/include/mysql' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--enable-mbstring' '--with-mysqli' '--with-pdo-mysql' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-curl=/usr' 

/ usr / local / apache-centosssl-php /是Apache先前版本的路径,该版本于2014年3月针对PHP 5.2编译。 看来Apache正在启动并使用我以前的PHP编译中的一些旧文件?

在命令行上,我得到:

# php -v
PHP 5.3.29 (cli) (built: Sep 16 2014 16:53:53) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies

我已经在php.ini和httpd.conf中搜索了“ apache-centosssl-php”,并且出现了零次。

我忘记了我在Apache中使用符号链接来链接到PHP模块:

libexec -> /usr/local/apache-centosssl-php/libexec

我将其修改为

libexec -> /usr/local/apache-php/libexec

它现在似乎正在工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM