Reputation: 295
I have downloaded the newest xampp dmg 7.0.6 on my mac, but after installation, the php version is still 5.6.11. I'm wondering do I have to set up the config of apache manually? If so, how do I change the version of php to php 7?
Upvotes: 3
Views: 8692
Reputation: 3308
I just did this yesterday on my PC. The Mac OSX setup should be a similar process. This is not an easy process. You will have to think & figure things out as you go through this process. I didn't document how I did it, but I'll share with you what I discovered to help you get through the snags that you might encounter along the way.
Use the CLI (Terminal Window) to navigate to the main PHP folder on your Mac OSX machine.
Backup your current version of XAMPP in the CLI. If it's in a folder like /yourpath/xampp
, then use mv xampp xampp_php5
to rename it to /yourpath/xampp_php5
. Then install the new version into the folder where your original XAMPP folder was at, like /yourpath/xampp/
. Now you can use a file comparison tool - like SmartSynchronize - to diff both folders after XAMPP with PHP 7.0.6 installs.
Then use the CLI to navigate into the /yourpath/xampp/php/
or /yourpath/xampp/php/bin/
folder. Run php -v
to see which version that the php file is using. If it tells you 7.0.6, then you can see about upgrading XAMPP to work with the new version. If not, you're in the wrong folder. Find the one for v.7.0.6. Make sure that you can get php -v
to tell you that you are in the right folder for v.7.0.6.
You should have the 64-bit version of XAMPP with PHP for Mac OSX. (For everyone else, go here: https://www.apachefriends.org/download.html Windows note: XAMPP is 32-bit & PHP is 32-bit. If you want a 64-bit version of PHP 7, you have to also install a 64-bit version of Apache from ApacheLounge. Otherwise, Apache won't bootstrap in XAMPP. Btw, Apache's main repo only has 32-bit binaries for Windows. I know, bizarre right?!)
Things that you will need to check:
/yourpath/apache_24/
instead of /yourpath/xampp/apache/
. It may not be the same folder path that XAMPP is using. You may have to replace all of the /apache_24/
paths with /yourpath/xampp/apache/
./yourpath/xampp/
and /yourpath/xampp_php5/
folders. Copy everything over from xampp_php5 that looks like it's needed into your new Apache version. The custom edits will have a very heavy XAMPP developer flavor to their code. You'll know it when you see it. I had to edit the following files:/yourpath/xampp/apache/conf/extra/httpd-vhosts.conf
& copy your settings over from your old xampp_php5 folder. If you use virtual hosts, the new version of Apache won't have any of your virtually hosted websites setup yet. That will wire up the localhost URL mappings./yourpath/xampp/apache/conf/extra/httpd-xampp.conf
to make sure that it references php7 everywhere that php5 appears in the old xampp_php5 folder. You might notice files that look like this /xampp/php/php5ts
have changed to this /xampp/php/php7ts
& places like this: php5_module
will have changed to this php7_module
./yourpath/xampp/php/php.ini-development
file over to php.ini
in that same folder. DIFF it with the /yourpath/xampp_php5/php/php.ini
file. Edit it as needed./yourpath/xampp/phpmyadmin/config.inc.php
/yourpath/xampp/apache/bin/
and run httpd -v
. It should tell you the version & whether it's 32-bit or 64-bit./yourpath/xampp/apache/log/
for errors.With some work, you can have Apache 2.x 64-bit, with PHP 7.x 64-bit & a new verison of PHPMyAdmin up & running in a couple of hours.
Good luck! :)
Upvotes: 1