Mac OSX PHP and XAMPP path issue(Mac OSX PHP 和 XAMPP 路径问题)
问题描述
我已经在运行 Yosemite 的 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 路径但是当我输入which 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 路径问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Mac OSX PHP 和 XAMPP 路径问题


基础教程推荐
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 在多维数组中查找最大值 2021-01-01