简体   繁体   中英

How to set php path for Xampp 8.0 in mac?

I have installed xampp 8.0 in macbook. There is no xampp folder in "applications" folder. Xampp 8.0 is installed at

/Users/kamlesh/.bitnami/stackman/machines/xampp/volumes/root/htdocs/ 

phpmyadmin and phpinfo of xampp 8.0 are working in the browser. If I add a test.php file in htdocs directory then it also works in the browser.

Xampp 8.0 has php 8 version and I want to set its path in bash_profile file so that when I use "php -v" command in terminal then it should show php 8.0 version. I have set strings in bash_profile file as, but not working yet:

export XAMPP_HOME=/Users/kamlesh/.bitnami/stackman/machines/xampp/volumes/root
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH

I have also tried below settings in bash_profile file, but still not getting php 8 version in command line:

export PATH=/opt/lampp/bin:${PATH}
export PATH

Any suggestion will be highly appreciated. Thanks a lot friends.

MAMP solved my all the problems. I have uninstalled Xampp because it is not built for Mac. I have added below strings in ~/.bash_profile file by command line:

export XAMPP_HOME=/Applications/MAMP/bin/php/php8.0.0
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH

Then closed the terminal and reopened again then checked php version by below command:

php -v

Output was 8.0

My composer is also using php 8.0 version now.

I hope, this will solve your problem also. Happy to help and share this solution:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM