【已解决】

软件管理下载的composer与php的运行项目相冲突

卜锦元

composer 与 php的读取目录相冲突,无法使用

PHP Warning:  Unknown: open_basedir restriction in effect. File(/usr/local/phpstudy/soft/composer/composer-1.6/composer.phar) is not within the allowed path(s): (/www/admin/) in Unknown on line 0

Warning: Unknown: open_basedir restriction in effect. File(/usr/local/phpstudy/soft/composer/composer-1.6/composer.phar) is not within the allowed path(s): (/www/admin/) in Unknown on line 0

PHP Warning:  Phar::mapPhar(): open_basedir restriction in effect. File(/usr/local/phpstudy/soft/composer/composer-1.6/composer.phar) is not within the allowed path(s): (/www/admin/) in /usr/local/phpstudy/soft/composer/composer-1.6/composer.phar on line 23

Warning: Phar::mapPhar(): open_basedir restriction in effect. File(/usr/local/phpstudy/soft/composer/composer-1.6/composer.phar) is not within the allowed path(s): (/www/admin/) in /usr/local/phpstudy/soft/composer/composer-1.6/composer.phar on line 23

PHP Warning:  require(): open_basedir restriction in effect. File(composer.phar) is not within the allowed path(s): (/www/admin/) in /usr/local/phpstudy/soft/composer/composer-1.6/composer.phar on line 24

Warning: require(): open_basedir restriction in effect. File(composer.phar) is not within the allowed path(s): (/www/admin/) in /usr/local/phpstudy/soft/composer/composer-1.6/composer.phar on line 24

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/phpstudy/soft/composer/composer-1.6/composer.phar on line 24

问题比较着急?请联系QQ:760483
  • 卜锦元
  • 卜锦元    2020-10-28 09:17:143楼

            您好,很感谢您的回复,现在已经关闭了  防跨站功能,composer可以正常的启动        但是当我cd切换到项目的目录时,再运行composer update命令,希望更新项目的扩展库代码时,提示我 必须指向www及其下的子目录,问题是我已经切换到了根目录的,项目根目录下也有composer.json的文件,就是没办法更新,要求我指向规定的目录

    +添加回复

  • 回复

    要在webshell里运行composer,且运行前要点击右边设置composer,具体使用方法和技巧可以到Linux版面板官方群交流

    Peter·Python · 2020-10-28 09:26:52
    回复
  • Peter·Python
  • Peter·Python  已被采纳  2020-10-28 08:41:042楼

    项目部署运行之后,你要取消防跨站才能进行一些敏感的跨目录操作

    +添加回复

  • 回复