I've been using composer for about a month now. And then one day composer shows me this message:
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.
I've installed composer globally as per the documentation.
which composer
/usr/local/bin/composer
Running sudo composer self-update gives me this message:
/usr/bin/env: php: No such file or directory
I've checked /usr/bin/env with this command:
whereis /usr/bin/env
env: /usr/bin/env /usr/bin/X11/env /usr/share/man/man1/env.1.gz
my php version:
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
It seems like /usr/bin/env in fact exists.
I'm using ubuntu 12.04LTS.
Update
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
Btw, i'm using xampp installed at /opt and php is in my PATH.
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
To change to version one, run the self-update command and pass in the --1 flag. This will change the composer to version one, and now you can install your dependencies. Once you have installed your dependencies, you can now run the same command and pass in --2 as the flag, which will switch back to composer version 2.
update / u# In order to get the latest versions of the dependencies and to update the composer. lock file, you should use the update command. This command is also aliased as upgrade as it does the same as upgrade does if you are thinking of apt-get or similar package managers.
Make sure you have no problems with your setup by running the installer's checks via curl -sS https://getcomposer.org/installer | php -- --check . Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer.
The error message:
/usr/bin/env: php: No such file or directory
tells you that php
is not found, i.e. php-cli
is not installed or php command is not in your PATH
environment variable.
So you need to install (sudo apt-get install php5-cli
) or put it in you PATH:
vim ~/.bashrc
PATH=$PATH:/path/to/php-cli/bin
export PATH
UPDATE
Accordingly to Composer with XAMPP for Linux issue symlinking php executable should solve your problem:
ln -s /opt/lampp/bin/php /usr/local/bin/php
this solution will work if you have xampp
ln -s /opt/lampp/bin/php /usr/local/bin/php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With