报告了不同PHP版本的问题 [英] Problem of different PHP versions reported

查看:52
本文介绍了报告了不同PHP版本的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已在开发计算机(Windows 7机器)上升级到PHP 5.3.

I have upgraded to PHP 5.3 on a development machine (Windows 7 box).

php-v显示

PHP 5.3.3 (cli) (built: Jul 21 2010 20:36:55)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

但是,phpinfo.php显示机器上的版本为:5.2.14,如下所示

However, phpinfo.php shows that the version on the machine is: 5.2.14 as shown

已加载的配置文件正确会为5.3加载正确的php.ini文件 配置文件(php.ini)路径错误读取为:C:\ Windows-我没有在上述路径上安装PHP.但是,我已经对该文件中的PHP文件夹和文件进行了递归搜索,但是搜索没有任何结果.

The loaded configuration file rightly loads the correct php.ini file for 5.3 The configuration file (php.ini) Path wrongly reads: C:\Windows - I don't install PHP on the said path. I have however done a recursive search of PHP folders and files within that file but the search turned up nothing.

应用程序似乎使用phpinfo报告的设置,而不使用php -v或php -m或php -i(或其他).

Applications seem to use the settings reported by the phpinfo and not by php -v or php -m or php -i (or else).

除了删除PHP文件夹并从头开始(这已经完成)之外,并确保Apache使用PHPINIDir指向正确的PHP目录,我应该怎么做才能解决这个问题?谢谢.

Apart from deleting the PHP folder and starting from scratch (which I have done), and ensuring that Apache points to the right PHP dir using PHPINIDir, what could I possibly do to solve this? Thanks.

推荐答案

你好

您还应该更新apache php 模块

You should also update apache php module


@soju-修复了该问题,谢谢,但是我想我对其他人可以更清楚一点.


@soju - that fixed it, thanks, but I thought I'd make this a little clearer for others.

Apache需要php模块来提供php文件.在Windows上,它是一个.dll文件.这将被称为:php5apache2_2.dll-位于您的php文件夹中.但是奇怪的是,在使用新版本升级php文件夹时,您可能会发现apache仍然使用旧的php模块文件.因此,尽管php -v正确报告了新版本,但Apache仍然查看旧的php模块(由phpinfo报告).要找出您拥有的模块版本,您可以:右键单击.dll文件>选择属性->查看详细信息选项卡.或者只是将鼠标悬停在文件上.

Apache requires the php module to serve php files. On Windows it comes as a .dll file. This would be called: php5apache2_2.dll - located within your php folder. Strangely though, during upgrading the php folder with a newer version, you may find out that apache still uses the old php module file. So while php -v correctly reports the new version, Apache still looks at the old php module (reported by phpinfo). To find out what module version you have, you could: right-click on the .dll file > select properties -> view the details tab. Or just hover on the file.

如果该版本不是您想要的版本,则可能需要寻找较新的版本并将其替换.先备份的好主意.另外,php5apache.dll文件可以使用并需要以下文件:php5ts.dll-因此请确保这些文件具有相同的版本.

If this version is not what you want, you might want to hunt for a newer version and replace it. Good idea to back up first. Also, the php5apache.dll file works with and requires the file: php5ts.dll - so ensure these files are the same versions.

使用带有指令的httpd.conf文件:

With your httpd.conf file with the directive:

LoadModule php5_module "\path to\php5apache2_2.dll"

您可以重新启动apache并微笑!

You may restart apache and smile!

这篇关于报告了不同PHP版本的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆