php – 无法自我更新作曲家?

前端之家收集整理的这篇文章主要介绍了php – 无法自我更新作曲家?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我已经使用作曲家大约一个月了.然后有一天作曲家给我看了这条消息:

Warning: This development build of composer is over 30 days old. It is
recommended to update it by running “/usr/local/bin/composer
self-update” to get the latest version.

我根据文档全局安装了composer.

which composer
/usr/local/bin/composer

运行sudo composer自我更新给了我这样的信息:

/usr/bin/env: PHP: No such file or directory

我检查了/usr/bin/env
使用此命令:

whereis /usr/bin/env
env: /usr/bin/env /usr/bin/X11/env /usr/share/man/man1/env.1.gz

我的PHP版本:

PHP 5.5.1 (cli) (built: Jul 26 2013 19:50:47) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0,Copyright (c) 1998-2013 Zend Technologies
    with Xdebug v2.2.3,Copyright (c) 2002-2013,by Derick Rethans

似乎/usr/bin/env实际上存在.

我正在使用ubuntu 12.04LTS.

更新

strace sudo composer self-update 2>&1 | grep open

open("/etc/ld.so.cache",O_RDONLY|O_CLOEXEC) = 3
open("/lib/i386-linux-gnu/libutil.so.1",O_RDONLY|O_CLOEXEC) = 3
open("/lib/i386-linux-gnu/libdl.so.2",O_RDONLY|O_CLOEXEC) = 3
open("/lib/i386-linux-gnu/libc.so.6",O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/locale-archive",O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/usr/share/locale/locale.alias",O_RDONLY|O_CLOEXEC) = 3
open("/usr/share/locale/en_PH/LC_MESSAGES/sudo.mo",O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/sudo.mo",O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_PH/LC_MESSAGES/sudo.mo",O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/sudo.mo",O_RDONLY) = -1 ENOENT (No such file or directory)
open("/var/run/utmp",O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3

顺便说一下,我正在/ opt使用xampp
PHP在我的路径.

echo $PATH

/home/chanhxc/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/chanhxc/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/lampp/bin:/home/chanhxc/pear/bin:/home/chanhxc/.composer/vendor/bin:/opt/lampp/bin
错误消息:

/usr/bin/env: PHP: No such file or directory

告诉你没有找到PHP,即没有安装PHP-cli或PHP命令不在你的PATH环境变量中.

所以你需要安装(sudo apt-get install PHP5-cli)或者把它放在你的路径中:

vim ~/.bashrc

PATH=$PATH:/path/to/PHP-cli/bin
export PATH

UPDATE

相应于Composer with XAMPP for Linux问题symlinking PHP可执行文件解决您的问题:

ln -s / opt / lampp / bin / PHP /usr/local / bin / PHP

原文链接:https://www.f2er.com/php/136724.html

猜你在找的PHP相关文章