Mac OSX PHP和XAMPP路径问题 [英] Mac OSX PHP and XAMPP path issue

查看:426
本文介绍了Mac OSX PHP和XAMPP路径问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在运行优胜美地的Mac OSX上安装了XAMPP 我已经创建了.bash_profile文件,如下所示:

I have installed XAMPP on Mac OSX running Yosemite I have created the .bash_profile file like this:

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

当我在终端中键入echo $ PATH时,我得到正确的XAMPP路径 但是当我键入哪个php"时,它显示/usr/bin/php

When I type echo $PATH in terminal, I get correct XAMPP path But when I type "which php" it shows /usr/bin/php

如何使XAMPP使用正确的php代替Mac随附的默认php?

How can I make my XAMPP use the correct php instead of default php that came with mac?

推荐答案

要使用XAMPP PHP和/Applications/XAMPP/bin/中的其他二进制文件,默认情况下,这是〜/.bash_profile

To use the XAMPP PHP and other binaries found in /Applications/XAMPP/bin/ by default this is the correct entry for ~/.bash_profile

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

以此加载更改(下次打开shell会话时将不需要):

Load the changes with this (won't be needed next time you open a shell session):

source ~/.bash_profile

确认:

$ which php
/Applications/XAMPP/bin/php

这篇关于Mac OSX PHP和XAMPP路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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