开发者

Change PHP version in IIS 6

开发者 https://www.devze.com 2023-03-24 23:26 出处:网络
Trying to upgrade from PHP 5.2.5 to 5.2.17 (and then to 5.3.6 once that works) on IIS 6.0, installing the language itself runs just fine and I changed the PHP.ini/ect locations that IIS uses for PHP,

Trying to upgrade from PHP 5.2.5 to 5.2.17 (and then to 5.3.6 once that works) on IIS 6.0, installing the language itself runs just fine and I changed the PHP.ini/ect locations that IIS uses for PHP, everything still works but when I run PHP info on my site it still says it's running PHP 5.2.5. Restarted IIS, restarted the server even, no difference. What do I do to change which version/what location of PHP IIS is using?

When I install PHP 5.3.6 the site no longer works, so I know installing different versions is doing SOMETHING, but I think it might only be changing the PHP.ini my server is using, not the version of PHP.

In addition to installing the windows binary release of PHP I've also tried installing PHP from Microsoft's Web Platform Installer开发者_高级运维 (both 5.3.6 and 5.2.17), after installing neither showed up as the current version in phpinfo either.


If you want to use php 5.3, you must install IIS FastCGI extension and run PHP as cgi script. From php 5.3 isapi is not supported. But everything works fine if you configure it, and as benefit you can use more php version simultaneously. IIS 6 is not a problem. Download PHP non thread safe.

For details see this, for example: http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/


  1. Download the latest VC11 x86 Non Thread Safe version of PHP from http://windows.php.net/download/
  2. Once the zip is downloaded, right click on the zip file and select properties. Make sure you unblock the file.
  3. Rename your current PHP folder to PHPold.
  4. Find your php.ini file and rename it to phpold.ini
  5. Extract the zip file to c:\temp\php.
  6. Copy the php folder from c:\temp to wherever your old PHP folder was.
  7. Go to your new php folder and copy php.ini-production and paste it to where your old php.ini file was
  8. Rename php.ini-production to php.ini
  9. On the server, make sure you have Notepad++ along with the Compare plugin. If you need the compare plugin, use these steps. http://www.davidtan.org/how-to-compare-two-text-files-using-notepad-plus/
  10. In the location that stores your phpold.ini and php.ini, right click on each of those files and open them with Notepad++. On the php.ini, only make changes to the lines with the >> next to them.
  11. Once the changes have been made, make sure you save php.ini.
  12. Go to Services and restart IIS.


Solution has been to move to Apache in my case. IIS 7 has better tools but IIS has proven to be a poor environment for development in this case.

0

精彩评论

暂无评论...
验证码 换一张
取 消