Search code examples
phpmacosxamppcommand-line-interface

Where is the PHP folder on XAMPP for MAC OS 10.12 system?


I've been tried to export a custom PATH on ~/bash_profile file by adding:

export XAMPP_HOME=/Applications/XAMPP
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH

But this doesn't work because the PHP path is incorrect.

Furthermore, I also ran phpinfo() and get the Configuration File but the path is /opt/lampp/etc that doesn't exist.

Therefore, I just need to change the default PHP CLI from version 5.5.6 to 7.1.11.

Can someone here please give me a help!!!?


Solution

  • After hours searching on Google, I've reached at this video that pointed me to the right point: https://www.youtube.com/watch?v=vT5luUaAcQ8

    Yes! Now I can change my PHP CLI version to any other since 5.3.

    Here are the steps from the video:

    1. To get started, go to https://php-osx.liip.ch/
    2. Scroll down to the One Line Installation section and copy the command for the version of PHP that you want to install
    3. Open up a Terminal window
    4. Paste the command and press Enter
    5. The PHP OSX installer will take care of loading the new version of PHP into the pre-installed copy of Apache
    6. If you want to run the new version of PHP from the command line, you’ll need to update your PATH
    7. To do that, you’ll need to add a line to your .bash_profile file.
    8. Type vim ~/.bash_profile and press Enter
    9. Press Shift-G to jump to the end of the file
    10. Press i to enter Insert mode
    11. Type export PATH=/usr/local/php5/bin:$PATH
    12. Press Escape to exit Insert mode
    13. Type :wq to save and quit
    14. Now you can close your Terminal window and open a new window to use the new path