Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP已编译,但phpinfo()显示旧版本_Php_Linux_Apache_Centos_Centos5 - Fatal编程技术网

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

PHP已编译,但phpinfo()显示旧版本,php,linux,apache,centos,centos5,Php,Linux,Apache,Centos,Centos5,我试图在CentOS上将PHP从5.2升级到5.3,但phpinfo()仍声称安装了PHP5.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-mbstrin

我试图在CentOS上将PHP从5.2升级到5.3,但phpinfo()仍声称安装了PHP5.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月针对PHP5.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

它现在似乎正在工作。

新版本是在旧版本的基础上安装的,还是安装到新位置?如果您将PHP安装到一个新的位置,是否更新了Apache配置以使用新的PHP?我不完全确定,但Apache将PHP作为一个模块运行,因此如果5.2模块仍然存在,您需要更改它。就像我说的,我不确定我的技术是否有点老了。