如何在MAC OS X 10.7 Lion上安装多个XAMPP版本或多个PHP版本 [英] How to install multiple XAMPP versions OR Multiple PHP versions on MAC OS X 10.7 Lion

查看:125
本文介绍了如何在MAC OS X 10.7 Lion上安装多个XAMPP版本或多个PHP版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在需要PHP 5.2的旧系统上做一些工作

我已经安装了XAMP 1.7.3,但是此版本具有PHP 5.3.

由于这项工作在接下来的几个月中可能会做几次,因此我正在考虑安装运行PHP 5.2的XAMP版本 同时,我参与了一些需要使用PHP 5.3的工作,因此我无法卸载当前的XAMP版本并安装使用PHP 5.2的版本.

XAMPP下载网站上非常清楚在安装任何XAMPP版本时,它将删除以前的版本.我已经做过一些研究,但找不到解决此问题的方法.

我设法在/Applications/XAMPP/xamppfiles/bin/下找到phpswitch,并使用它的列表操作向我显示我仅安装了PHP 5.3.1并且处于活动状态.我试图弄清楚如何使用phpswitch下载/安装/激活PHP 5.2,但没有成功.

所以我正在寻找一种安装多个XAMPP或安装PHP 5.2并将其激活为XAMPP的方法(通过phpswitch或其他方式)

解决方案

您可以安装XAMPP的并行版本-每个主要PHP版本均安装一个.只是不要同时运行两者.

将XAMPP的每个实例安装在其自己的文件夹中.

我在一个名为

的文件夹下进行此操作

XAMPPInstalls/XAMPP182-PHP54 /XAMPP183-PHP55/

在每个XAMPP文件夹中,您都会找到一个.exe以启动该特定XAMPP堆栈的控制器.我已经为它们创建了快捷方式,将它们重命名为"XAMPP182-ControlPanel"和"XAMPP183-ControlPanel",并将它们放置在我的桌面上.

当我需要在PHP5.4上运行本地站点时,请单击XAMPP182-ControlPanel并启动Apache和MySQL服务器.

当我需要将本地站点切换到PHP5.5时,请单击XAMPP182-ControlPanel并关闭Apache和MySQL服务器,然后单击XAMPP182-ControlPanel并启动该堆栈中的Apache和MySQL服务器. /p>

这只需要几秒钟.

此外,我使用软链接",以便在一个文件夹中完成本地网站的所有配置-然后创建一个连接"(即,一个源文件夹,该文件夹在每个XAMPP堆栈的Apache配置中进行自我复制) ).

对此有一篇非常好的文章,名为"实践开发2:工作环境",作者是Joomla的Marco Dings!关于如何设置工作环境以运行多个本地XAMPP安装,使用基于名称的托管"的多个本地网站以及如何使其全部井井有条的社区杂志.

我不完全使用Ding的设置-我已经进行了调整,以使本地Web项目更加有条理和精简-但是我的设置基于Ding的方法.

注意:本文在Joomla中!社区杂志,不是特定于Joomla!的,因此您可以将此设置用于正在处理的任何PHP/Apache/MySQL项目.

现在有很多方法可以做到这一点(例如,使用Oracle的VM Virtual Box),但是除非您需要完全"复制远程托管环境,否则这可能是过分的.例如,如果您正在运行专用主机",并且希望紧密复制专用主机的环境并尽可能紧密地进行设置,则可以使用虚拟机虚拟机设置-这允许您运行多个虚拟机(即不同的设置),然后将确切的设置克隆到您的实时服务器中.同样,如果您的大多数项目都将要进入共享托管"环境,那就要大刀阔斧,因为无论如何您对设置没有太多控制权.

XAMPP的多个实例的并行安装要简单得多,您可以按照Ding的文章进行设置.它应该满足您的要求.

我提到Oracle VM VirtualBox是因为您至少应该了解它作为一个选项.

I need to do some work on a legacy system that requires PHP 5.2

I already have XAMP 1.7.3 installed but this version has PHP 5.3.

Since this a work I might do for a couple of times in the next months, I was thinking about installing a XAMP version that runs PHP 5.2 At the same time I'm involved into some work that requires me to use PHP 5.3, so I just can`t uninstall my current XAMP version and install one that uses PHP 5.2

On XAMPP Download Website it's pretty clear that on installing any XAMPP version it will remove previous one. I've done some research but couldn't find a way to get around this.

I managed to find phpswitch under /Applications/XAMPP/xamppfiles/bin/ and using it's list action showed me that I only have PHP 5.3.1 installed and active. I tried to figured out on how to download/install/activate PHP 5.2 using phpswitch but had no success.

So what I'm looking for is a way to install multiple XAMPP or installing PHP 5.2 and activating it for XAMPP (either through phpswitch or another way)

解决方案

You can install parallel versions of XAMPP - one for each major version of PHP. Just don't run both at the same time.

Install each instance of XAMPP in it's own folder.

I do this under a folder called

XAMPPInstalls/XAMPP182-PHP54 /XAMPP183-PHP55/

In each XAMPP folder, you'll find an .exe to launch the controller for that specific XAMPP stack. I've created shortcuts to those, renamed them to 'XAMPP182-ControlPanel' and 'XAMPP183-ControlPanel' and placed those on my desktop.

When I need to run local site on PHP5.4, I click on XAMPP182-ControlPanel and fire up the Apache and MySQL servers.

When I need to switch a local site to PHP5.5, I click on XAMPP182-ControlPanel and shut down the Apache and MySQL servers, then I click XAMPP182-ControlPanel and fire up the Apache and MySQL servers in that stack.

This takes just a few seconds.

Also, I use 'soft-linking' so that I do all my configuration for my local web sites in one folder - then create a 'junction' (i.e. a source folder that replicates itself in the Apache configs for each XAMPP stack).

There is a really good article on this called 'Practical Development 2: Working Environment' by Marco Dings in the Joomla! Community Magazine on how to set up your work environment to run multiple local XAMPP installs, multiple local web sites using 'name based hosting,' and how to keep it all organized.

I don't use Ding's set-up exactly - I've tweaked to get my local web projects even more organized and streamlined - but my set-up is based on Ding's approach.

NOTE: The article, while in the Joomla! Community Magazine, is not specific to Joomla!, so you can use this set-up for whatever PHP/Apache/MySQL projects you are working on.

Now there are lots of ways to do this (e.g. using Oracle's VM Virtual Box), but that might be overkill unless you need to replicate your remote hosting environment 'exactly.' For example, if you are running a 'dedicated host' and want to closely replicate dedicated host's environment and set up as closely as possible, then you'd go with VM Virtual Box Set-Up - this allows you to run multiple VM's (i.e. different set-ups) and then clone the exact set-up to your live server. Again, overkill if most of your projects are going to 'shared hosting' environments as you don't have much control over the set-up anyways.

Parallel installation of multiple instance of XAMPP is much much much simpler and you can set it up as per Ding's article. It should cover your requirements.

I've mentioned Oracle VM VirtualBox because you should at least know about it as an option.

这篇关于如何在MAC OS X 10.7 Lion上安装多个XAMPP版本或多个PHP版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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