将PHP路径更改为MAMPs PHP [英] change the PHP path to MAMPs PHP

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

问题描述

我正在OSX 10.5.8上使用MAMP运行PHP

I'm running PHP with MAMP on OSX 10.5.8

因此,如果我想从控制台运行脚本,我总是需要编写

So if I want to run a script from console I always need to write

/applications/mamp/bin/php5.3/bin/php path/to/script

这很烦人.有没有一种方法可以将默认路径更改为php,以便我可以编写

which is annoying. Is there a way to change the default path to php so that I can write

php path/to/script

并且仍然使用MAMPs PHP版本吗?

and still uses MAMPs PHP version?

推荐答案

在主目录中创建一个名为.bash_profile的文件(如果还没有此文件),并将其添加到文件中:

Create a file called .bash_profile on your home directory (if you don't have this file already), and add this to the file:

export PATH=/Applications/mamp/bin/php5.3/bin:$PATH

然后退出并重新启动Terminal.app

Then quit and relaunch Terminal.app

这篇关于将PHP路径更改为MAMPs PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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