您的位置:首页 > 编程语言 > PHP开发

OSX 改变PHP安装路径环境变量

2014-09-29 11:42 381 查看
当使用XAMPP来学习Laravel的时候,用composer安装laravel总是报错,说mcrypt is required ,但是当我在终端里打印 which php 显示的是usr/bin/php 没有用XAMPP安装的PHP,所以要改成使用XAMPP中的PHP版本,做法如下:

To those that uses XAMPP 1.7.3 and Mac

Go to Terminal

Enter
which
php


If it says /usr/bin/php, then proceed to 3.

Enter
sudo
nano ~/.bash_profile
(or
sudo
vim ~/.bash_profile
if you know how to use it)

Then paste this
export
PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"


Ctrl - O then enter to save, then ctrl - X to exit.

Type cd ~

type . .bash_profile

restart terminal.

Enter
which
php


Good luck
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: