我使用curl安装了composer,现在我尝试创建laravel项目,但输入命令后出现错误
composer create-project laravel/laravel test-project --prefer-dist
PHP Warning: Phar::mapPhar(): open_basedir restriction in effect. File(/usr/local/bin/composer) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/) in /usr/local/bin/composer on line 13
PHP Warning: require(phar://composer.phar/bin/composer): failed to open stream: phar error: invalid url or non-existent phar "phar://composer.phar/bin/composer" in /usr/local/bin/composer on line 15
PHP Fatal error: require(): Failed opening required 'phar://composer.phar/bin/composer' (include_path='.:/usr/share/pear') in /usr/local/bin/composer on line 15
最佳答案
针对您的问题有不同的解决方案。
你是如何安装 php 的?您是系统的管理员吗? 如果是这样,请编辑 php.ini 以将/usr/local/bin/添加到 open_basedir 中允许的路径。
关于php - Composer创建项目错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22936964/