Php 未定义编写器或环境

Php 未定义编写器或环境,php,composer-php,Php,Composer Php,我试图执行一个函数来更新composer,但没有定义composer 我的composer.json在777中 我的作曲家洛克在644 多谢各位 一,/ 结果: Array ( [0] => Reading /home/www/demo/shop/composer.json [1] => Loading config file /home/www/demo/shop/composer.json [2] => Checked CA file /etc/ssl/certs/ca-c

我试图执行一个函数来更新composer,但没有定义composer

我的composer.json在777中 我的作曲家洛克在644

多谢各位

一,/

结果:

Array ( [0] => Reading /home/www/demo/shop/composer.json [1] => Loading config file /home/www/demo/shop/composer.json [2] => Checked CA file /etc/ssl/certs/ca-certificates.crt: valid [3] => Executing command (/home/www/demo/shop): git branch --no-color --no-abbrev -v [4] => Executing command (/home/www/demo/shop): git describe --exact-match --tags [5] => Executing command (/home/www/demo/shop): git log --pretty="%H" -n1 HEAD [6] => Executing command (/home/www/demo/shop): hg branch [7] => Executing command (/home/www/demo/shop): fossil branch list [8] => Executing command (/home/www/demo/shop): fossil tag list [9] => Executing command (/home/www/demo/shop): svn info --xml [10] => Cannot create cache directory /home/www/demo/shop//cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache [11] => Cannot create cache directory /home/www/demo/shop//cache/files/, or directory is not writable. Proceeding without cache [12] => Reading /home/www/demo/shop/includes/ClicShopping/External/vendor/composer/installed.json [13] => Running 1.8.4 (2019-02-11 10:52:10) with PHP 7.3.2-3 on Linux / 5.0.0-31-generic [14] => [15] => In Application.php line 618: [16] => [17] => [Symfony\Component\Console\Exception\CommandNotFoundException] [18] => Command "/home/www/demo/shop/composer" is not defined. [19] => [20] => [21] => Exception trace: [22] => () at /usr/share/php/Symfony/Component/Console/Application.php:618 [23] => Symfony\Component\Console\Application->find() at /usr/share/php/Symfony/Component/Console/Application.php:229 [24] => Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:258 [25] => Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:148 [26] => Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:104 [27] => Composer\Console\Application->run() at /usr/bin/composer:57 [28] => ) 1
包含缓存目录:

Array ( [0] => Reading /home/www/clicshopping_test/shop/composer.json [1] => Loading config file /home/www/clicshopping_test/shop/composer.json [2] => Checked CA file /etc/ssl/certs/ca-certificates.crt: valid [3] => Executing command (/home/www/clicshopping_test/shop): git branch --no-color --no-abbrev -v [4] => Executing command (/home/www/clicshopping_test/shop): git describe --exact-match --tags [5] => Executing command (/home/www/clicshopping_test/shop): git log --pretty="%H" -n1 HEAD [6] => Executing command (/home/www/clicshopping_test/shop): hg branch [7] => Executing command (/home/www/clicshopping_test/shop): fossil branch list [8] => Executing command (/home/www/clicshopping_test/shop): fossil tag list [9] => Executing command (/home/www/clicshopping_test/shop): svn info --xml [10] => Reading /home/www/clicshopping_test/shop/includes/ClicShopping/External/vendor/composer/installed.json [11] => Running 1.8.4 (2019-02-11 10:52:10) with PHP 7.3.2-3 on Linux / 5.0.0-31-generic [12] => [13] => In Application.php line 618: [14] => [15] => [Symfony\Component\Console\Exception\CommandNotFoundException] [16] => Command "/home/www/clicshopping_test/shop/composer" is not defined. [17] => [18] => [19] => Exception trace: [20] => () at /usr/share/php/Symfony/Component/Console/Application.php:618 [21] => Symfony\Component\Console\Application->find() at /usr/share/php/Symfony/Component/Console/Application.php:229 [22] => Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:258 [23] => Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:148 [24] => Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:104 [25] => Composer\Console\Application->run() at /usr/bin/composer:57 [26] => ) 1

试试这个。这对我有用

我想你应该在这两个文件上设置664的权限


由于某些安全原因,777有时是不可接受的。此时,将权限级别更改为664。

我认为您的命令如下:
$cmd='/usr/bin/composer diagnose-vvv 2>&1'我包含了缓存目录,但结果是相同的,请参见上面我添加了带有缓存目录的结果
Array ( [0] => Reading /home/www/clicshopping_test/shop/composer.json [1] => Loading config file /home/www/clicshopping_test/shop/composer.json [2] => Checked CA file /etc/ssl/certs/ca-certificates.crt: valid [3] => Executing command (/home/www/clicshopping_test/shop): git branch --no-color --no-abbrev -v [4] => Executing command (/home/www/clicshopping_test/shop): git describe --exact-match --tags [5] => Executing command (/home/www/clicshopping_test/shop): git log --pretty="%H" -n1 HEAD [6] => Executing command (/home/www/clicshopping_test/shop): hg branch [7] => Executing command (/home/www/clicshopping_test/shop): fossil branch list [8] => Executing command (/home/www/clicshopping_test/shop): fossil tag list [9] => Executing command (/home/www/clicshopping_test/shop): svn info --xml [10] => Reading /home/www/clicshopping_test/shop/includes/ClicShopping/External/vendor/composer/installed.json [11] => Running 1.8.4 (2019-02-11 10:52:10) with PHP 7.3.2-3 on Linux / 5.0.0-31-generic [12] => [13] => In Application.php line 618: [14] => [15] => [Symfony\Component\Console\Exception\CommandNotFoundException] [16] => Command "/home/www/clicshopping_test/shop/composer" is not defined. [17] => [18] => [19] => Exception trace: [20] => () at /usr/share/php/Symfony/Component/Console/Application.php:618 [21] => Symfony\Component\Console\Application->find() at /usr/share/php/Symfony/Component/Console/Application.php:229 [22] => Symfony\Component\Console\Application->doRun() at /usr/share/php/Composer/Console/Application.php:258 [23] => Composer\Console\Application->doRun() at /usr/share/php/Symfony/Component/Console/Application.php:148 [24] => Symfony\Component\Console\Application->run() at /usr/share/php/Composer/Console/Application.php:104 [25] => Composer\Console\Application->run() at /usr/bin/composer:57 [26] => ) 1