6

I using macOS High Sierra version 10.13.1

I want to install two xampp in my Mac (xampp 7.0.27 and xampp 7.1.13)

First, I had install xampp 7.0.27 in my Mac and it works. It's stored in /Applications/XAMPP

Second, I try to install xampp 7.1.13 in my Mac. Seems it's failed. Because it's stored in /Applications/XAMPP too. Does not seem to be custom the path

How can I solve this problem?

moses toh
  • 12,344
  • 71
  • 243
  • 443
  • Why do you need to install two versions of the same application? – Martin Bean Feb 03 '18 at 14:16
  • 1
    @MartinBean I have two project. The projects using different php version. – moses toh Feb 03 '18 at 14:19
  • you can install wamp and xampp – pedram shabani Feb 03 '18 at 14:20
  • @pedramshabani Why can not I install 2 xampp on mac os? I can install 2 xampp in windows – moses toh Feb 03 '18 at 14:24
  • Possible duplicate of [Is there way to use two PHP versions in XAMPP?](https://stackoverflow.com/questions/45790160/is-there-way-to-use-two-php-versions-in-xampp) – rickdenhaan Feb 03 '18 at 14:26
  • I did not try this..always i have xampp and wamp ....or you can have Portable xampp... – pedram shabani Feb 03 '18 at 14:28
  • The major problem is that apache and mysql need a specific port to bind to. If you change their default ports then there's no reason why you can't have 2 installations of them. You may need to install them manually though – apokryfos Feb 03 '18 at 14:29
  • @Success Man You’d be better off looking at something like Vagrant, where you can have a self-contained environment with separate PHP versions etc for each of your projects. – Martin Bean Feb 03 '18 at 15:27
  • @rickdenhaan This is not windows. This is Mac – moses toh Feb 05 '18 at 07:07
  • @apokryfos You should answer this question in more detail. I have tried it like my question. But it seems it can not – moses toh Feb 05 '18 at 07:09
  • @MartinBean I'm still confused. You should answer this question in more detail. I need a specific answer – moses toh Feb 05 '18 at 07:11
  • @pedramshabani Seems wamp is not support Mac OS – moses toh Feb 05 '18 at 08:06
  • oh i don't know it:-(...and what about EasyPHP 5.3.9 or Portable xampp – pedram shabani Feb 05 '18 at 08:12
  • @pedramshabani Where can I download portable xampp? https://www.apachefriends.org/download.html. Is XAMPP-VM / PHP 7.1.13? – moses toh Feb 05 '18 at 08:45
  • I search about this.for mac you can not use Portable version.it is posible install xamp on USB stick and then use of USB stick on mac but It's very troublesome.This is easier--> https://stackoverflow.com/questions/12501003/how-to-install-multiple-xampp-versions-or-multiple-php-versions-on-mac-os-x-10-7 – pedram shabani Feb 05 '18 at 09:53
  • @SuccessMan Principle is the same for Mac or Windows. You can install multiple PHP versions on Mac, then change XAMPP's Apache config to point to a specific version as needed. – rickdenhaan Feb 05 '18 at 19:31

1 Answers1

9

A not-so-pretty solution that works:

  1. Install the first XAMPP version and then rename /Applications/XAMPP to something like /Applications/XAMPP-7.0.27.

  2. After that, install the second XAMPP version and then rename /Applications/XAMPP to something like /Applications/XAMPP-7.1.13.

In order to run the preferred version just rename it back to /Applications/XAMPP and run the manager-osx.

LyK
  • 479
  • 7
  • 18
  • 3
    This is also how I handle the issue. I also recommend placing the htdocs directory elsewhere on your system, and symlinking from each XAMPP instance. This way you can use the same project code in different environments. – majorobot Jan 22 '19 at 16:27
  • Then everytime you want to run the xampp server change the folder name back to XAMPP and then the xampp console will work.. save different versions, then run from the original name whichever you want to run – DragonFire Feb 26 '21 at 02:54
  • @majorobot how about the mysql? How to get same db in different environtment? – webchun Aug 24 '23 at 00:43
  • @webchun -- that's a downside. They will be different MySQL instances. The different versions of XAMPP have different versions of MySQL, so it's likely not possible/advisable to share dbs between instances. If you're able to set up a db external to XAMPP, I suppose you could use that for all of your XAMPP instances. – majorobot Aug 28 '23 at 19:14
  • @majorobot I ended up doing the symlink for the physical mysql data folder. It works perfectly just like the htdocs folder ;) – webchun Aug 30 '23 at 02:31
  • Good tip, @webchun. May try that myself (after backing up the data first). – majorobot Aug 31 '23 at 14:10