好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

解决brew安装composer的open_basedir的坑

若是出现如下错误,那么恭喜你入坑成功

PHP Warning:  Phar::mapPhar(): open_basedir restriction in effect. File(/usr/local/Cellar/composer/1.6.5/bin/composer) is not within the allowed path(s): (/web/:/web/feifeixueyuan/:/var/tmp/:/private/tmp/:/tmp/:/usr/local/bin/) in /usr/local/Cellar/composer/1.6.5/bin/composer on line 23

不要慌张,看下方的解决办法:

1、找到你的php.ini文件,找到open_basedir文件,然后把你错误中的/usr/local/Cellar/composer/1.6.5/bin/这个目录按照正确的格式题写好。

将 /web/:/web/feifeixueyuan/:/var/tmp/:/private/tmp/:/tmp/:/usr/local/bin/  改为 /web/:/web/feifeixueyuan/:/var/tmp/:/private/tmp/:/tmp/:/usr/local/bin/:/usr/local/Cellar/composer/1.6.5/bin/

备注:上面的路径是我电脑的路径,请安装你自己配置的修改

2、重启你的php再次查看即可。

多说一下若是你不是通过brew 安装的composer,碰到此问题也是open_basedir的问题,按照上面的步骤处理即可。

查看更多关于解决brew安装composer的open_basedir的坑的详细内容...

  阅读:93次