我们使用PHP 7.0运行XAMPP,因为我们的新产品需要PHP 7。
但也有一些旧的项目使用mysql_connect等函数。这些在PHP 7.0中被删除。
那么,是否有一种方法可以轻松地在XAMPP中更改PHP版本?
注意:请不要建议将旧项目升级到与新版本兼容,因为我无法做到这一点 这些决定是我作为开发人员(只是一名员工)无法得到的。
我们使用PHP 7.0运行XAMPP,因为我们的新产品需要PHP 7。
但也有一些旧的项目使用mysql_connect等函数。这些在PHP 7.0中被删除。
那么,是否有一种方法可以轻松地在XAMPP中更改PHP版本?
注意:请不要建议将旧项目升级到与新版本兼容,因为我无法做到这一点 这些决定是我作为开发人员(只是一名员工)无法得到的。
当前回答
您可以有两个不同版本的XAMPP。
Download those files from https://www.apachefriends.org/download.html and install into a directory of your choice, for example in C:\5.6.31\xampp and C:\7.1.18\xampp. After every installation go to installed directory (ex. C:\5.6.31\xampp, C:\7.1.18\xampp) and start the "setup_xampp.bat" and you should see something like this. You can make shortcuts of "xampp-control.exe" on your desktop (right click on "xampp-control.exe" Send to -> Desktop) and rename shortcuts for ex. "xampp 5.6.31" and "xampp 7.1.8". Start XAMPP control panel with double-click on "xampp-control.exe" or previously created shortcut and start Apache and MySQL servers. To test installiation open your browser and type 127.0.0.1 or localhost in the location bar. You should see XAMPP start screen. Do not open more then one XAMPP control panel. XAMPP uninstall? Simply remove the "xampp" Directory. But before please shutdown the apache and mysql. That's all. You can use different php versions opening corresponding XAMPP control panel.
其他回答
我建议使用Xampp PHP切换器由JackieDo。 在非常简单的安装之后,你可以使用命令xphp switch [VERSION]来更改php版本。
您可以有两个不同版本的XAMPP。
Download those files from https://www.apachefriends.org/download.html and install into a directory of your choice, for example in C:\5.6.31\xampp and C:\7.1.18\xampp. After every installation go to installed directory (ex. C:\5.6.31\xampp, C:\7.1.18\xampp) and start the "setup_xampp.bat" and you should see something like this. You can make shortcuts of "xampp-control.exe" on your desktop (right click on "xampp-control.exe" Send to -> Desktop) and rename shortcuts for ex. "xampp 5.6.31" and "xampp 7.1.8". Start XAMPP control panel with double-click on "xampp-control.exe" or previously created shortcut and start Apache and MySQL servers. To test installiation open your browser and type 127.0.0.1 or localhost in the location bar. You should see XAMPP start screen. Do not open more then one XAMPP control panel. XAMPP uninstall? Simply remove the "xampp" Directory. But before please shutdown the apache and mysql. That's all. You can use different php versions opening corresponding XAMPP control panel.
我只是想分享我的新发现:https://laragon.org/docs/index.html
我刚用了一个小时,看起来很不错。
你可以添加和切换PHP版本, 它有一键安装Wordpress, laravel等 它自动创建vhosts与每个应用程序的名称(例如。appname.test) 你可以选择你当前的htdocs文件夹作为WWW根文件夹 您只需添加其他PHP版本,将它们提取到文件夹中,并从列表中选择它们 它会在每次更改后自动重载apache 添加phpMyAdmin就像下载它一样简单,并把它放在{LARAGON_DIR}\etc\apps\phpMyAdmin等…
拉拉贡文档
如何添加另一个PHP版本的Laragon
如何添加phpMyAdmin到Laragon
我和拉拉贡没有任何关系。刚刚在谷歌上找到它,寻找“XAMPP Windows替代品”
我使用unisserver。
它内置了这个功能。
http://www.uniformserver.com/
就是这么简单。
统一服务器是一个免费的轻量级WAMP服务器解决方案。小于24MB,模块化设计,包括最新版本的Apache2, Perl5, PHP(在PHP53, PHP54, PHP55或PHP56之间切换),MySQL5或MariaDB5, phpMyAdmin或Adminer4。不需要安装!没有注册尘埃!打开行李,发动吧!
它甚至可以用u盘运行。有cron仿真,支持perl, mariaDB,几个版本的Mysql, filezilla服务器和其他一些东西。
是的,你可以。我假设您已经安装了xampp。所以,
关闭所有xampp实例。使用任务管理器停止apache和mysqld。 然后将xampp重命名为xampp1或xampp名称之后的其他名称。 现在下载另一个xampp版本。只创建文件夹名xampp。在那里安装下载的xampp。 现在,根据您需求的xampp版本,只需将目标文件夹重命名为xampp,将其他文件夹重命名为不同的名称。
这就是我安装多个xampp的工作方式