简体   繁体   English

PHP 5.2和5.3一起

[英]PHP 5.2 and 5.3 together

I have XAMPP with PHP 5.2, but my new projects need PHP 5.3 How to have PHP 5.2 and 5.3 together? 我有XAMPP和PHP 5.2,但是我的新项目需要PHP 5.3。如何将PHP 5.2和5.3结合在一起?

I have winXP. 我有winXP。

You can do one of the following: 您可以执行以下操作之一:

  • Ensure your older apps can run on 5.3 while not using 5.3 specific features. 确保您的旧版应用程序可以在5.3上运行,而不使用5.3特定功能。 This is probably the best route as it will tighten your code and it will run on more platforms, especially in the future when more production environments use 5.3 only. 这可能是最好的方法,因为它将加强您的代码并且可以在更多平台上运行,尤其是在将来更多的生产环境仅使用5.3时。

    If this is for development purposes only you can also consider: 如果仅出于开发目的,您还可以考虑:

  • multiple installations of XAMPP and switch between them when necessary via simple folder rename (somewhat tedious) XAMPP的多个安装,并在需要时通过简单的文件夹重命名(有些乏味)在它们之间进行切换

  • php-switch (very tedious) php-switch (非常乏味)

  • setup two apache servers on the same machine running different PHP versions 运行不同PHP版本的同一台计算机 设置两个Apache服务器

You've two choices: run two servers on a different port, or use CGI. 您有两个选择:在不同的端口上运行两个服务器,或使用CGI。

You can get XAMPP with PHP 5.3.1 here: http://www.apachefriends.org/en/xampp-windows.html#641 Edit \\xampp\\apache\\conf\\httpd.conf , and change Listen to Listen 8080 for example. 你可以用XAMPP PHP 5.3.1这里: http://www.apachefriends.org/en/xampp-windows.html#641编辑\\xampp\\apache\\conf\\httpd.conf ,并改变ListenListen 8080例如。 Then run \\xampp\\apache_start.bat to start that server instance. 然后运行\\xampp\\apache_start.bat以启动该服务器实例。 Optionally, change DocumentRoot to your project directory. (可选)将DocumentRoot更改为您的项目目录。

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

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