大网数据广告活动
服务器运维问答

Installed new version of php but Apache still using the old version

· 52CE 我爱测

I manually installed php 5.4 on Ubuntu 10.04. The old version was 5.3.2. Now if i check the php version it shows 5.4: max@ubuntu:/etc/php5$ php -v PHP 5.4.0 (cli) (built: Jul 21 2015 14:04:16) Copyright (c) 1997-2012 The PHP Grou…

问题原文

原帖链接 · user1800997 · CC BY-SA 3.0

I manually installed php 5.4 on Ubuntu 10.04. The old version was 5.3.2. Now if i check the php version it shows 5.4:

max@ubuntu:/etc/php5$ php -v
PHP 5.4.0 (cli) (built: Jul 21 2015 14:04:16)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

But if i load index.php file in /var/www/ the apache still shows that the php version is 5.3.2.

How to make apache recognize the new php 5.4 version?

社区高分解答

原帖链接 · ohjay · CC BY-SA 4.0

Same problem here, but a2dismod did not work. I solved it removing the old apache config from /etc/apache2/conf-enabled and adding the right one from conf-available

cd /etc/apache2/conf-enabled
sudo rm php5.6-fpm.conf
sudo ln -s ../conf-available/php7.2-fpm.conf

restart apache et voilà!

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-07-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。