Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

edgpaez's avatar

composer & php not found

Hi there!

I have tried to publish my application to a server hosted by rackspace. it's an Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM) instance with 4gbs of RAM.

Now when I try to deploy the application I get:

Warning: Permanently added the RSA host key for IP address '131.103.20.167' to the list of known hosts.

From bitbucket.org:edgpaez/my-application

branch release/beta1 -> FETCH_HEAD

Already up-to-date.

/home/forge/.forge/provision-286807.sh: line 3: composer: command not found

/home/forge/.forge/provision-286807.sh: line 4: php: command not found

There wasn't any error while installing, I saved the installation output to a file a with flee but I can't see the file now because it is in the /root folder. (I tried to sudo with my original root password obtained from rackspace with no success)

EDIT: I also found out that I can no longer see the status of the server via mycould.rackspace.com I know get The Monitoring Agent is disconnected.

EDIT2: Trying to access the IP address of the server I get a No data received

I tried reaching out via de contact form but I think this is also a good place to get help, Thanks :(

0 likes
6 replies
fideloper's avatar

Need more information on other operations made on the server. For example, how was stuff added to the directory /root? That's usually the folder for user root, so if you were performing operations as user root, then user "forge" will have issues reading them.

Was this a clean (freshly created) server when you hooked it into Forge?

edgpaez's avatar

Hi there @fideloper thank you for replying!

when you create a custom VPS Forge tells you to write a command a little like this:

wget -O forge.sh https://forge.laravel.com/servers/8178/vps?forge_token=xxxx; bash forge.sh

What I did was add | tee output.log so that the output could be saved in a file, and given I had just SSHed with root I was in the /root directory. This is what I did:

wget -O forge.sh https://forge.laravel.com/servers/8178/vps?forge_token=xxxx; bash forge.sh | tee installation.log

To answer your other question, what I did before was rebuild the instance with ubuntu 14.04. Which basically is deleting the instance and the creating another. (I'll do that just to double check)

Regards

edgpaez's avatar

Hi!

I believe this is related to /etc/apt/sources.list.

I found the places where installing PHP and nginx resulted in an error in forge.sh:

WARNING: The following packages cannot be authenticated! libmemcached11 php5-common php5-curl php5-gd php5-gmp php5-imap php5-mcrypt php5-pgsql php5-json php5-cli php5-readline php5-sqlite php5-mysqlnd php-pear php5-apcu php5-dev php5-memcached php5-xdebug dh-php5 E: There are problems and -y was used without --force-yes ln: failed to create symbolic link '/etc/php5/mods-available': No such file or directory sudo: php5enmod: command not found nginx: unrecognized service forge.sh: line 215: php: command not found curl: (23) Failed writing body (0 != 8030) mv: cannot stat 'composer.phar': No such file or directory sed: can't read /etc/php5/cli/php.ini: No such file or directory sed: can't read /etc/php5/cli/php.ini: No such file or directory sed: can't read /etc/php5/cli/php.ini: No such file or directory sed: can't read /etc/php5/cli/php.ini: No such file or directory

and

WARNING: The following packages cannot be authenticated! php5-common php5-json php5-cli php5-fpm php5-readline E: There are problems and -y was used without --force-yes rm: cannot remove '/etc/nginx/sites-enabled/default': No such file or directory rm: cannot remove '/etc/nginx/sites-available/default': No such file or directory nginx: unrecognized service sed: can't read /etc/php5/fpm/php.ini: No such file or directory sed: can't read /etc/php5/fpm/php.ini: No such file or directory sed: can't read /etc/php5/fpm/php.ini: No such file or directory sed: can't read /etc/php5/fpm/php.ini: No such file or directory sed: can't read /etc/php5/fpm/php.ini: No such file or directory sed: can't read /etc/php5/fpm/php.ini: No such file or directory sed: can't read /etc/nginx/nginx.conf: No such file or directory sed: can't read /etc/nginx/nginx.conf: No such file or directory sed: can't read /etc/php5/fpm/pool.d/www.conf: No such file or directory sed: can't read /etc/php5/fpm/pool.d/www.conf: No such file or directory sed: can't read /etc/php5/fpm/pool.d/www.conf: No such file or directory sed: can't read /etc/php5/fpm/pool.d/www.conf: No such file or directory sed: can't read /etc/php5/fpm/pool.d/www.conf: No such file or directory sed: can't read /etc/php5/fpm/pool.d/www.conf: No such file or directory sed: can't read /etc/nginx/nginx.conf: No such file or directory sed: can't read /etc/nginx/nginx.conf: No such file or directory forge.sh: line 271: /etc/nginx/sites-available/catch-all: No such file or directory ln: failed to create symbolic link '/etc/nginx/sites-enabled/catch-all': No such file or directory php5-fpm: unrecognized service nginx: unrecognized service uid=1002(forge) gid=1002(forge) groups=1002(forge),27(sudo),33(www-data) forge : forge sudo www-data forge.sh: line 314: pecl: command not found forge.sh: line 315: /etc/php5/mods-available/mongo.ini: No such file or directory ln: failed to create symbolic link '/etc/php5/fpm/conf.d/20-mongo.ini': No such file or directory ln: failed to create symbolic link '/etc/php5/cli/conf.d/20-mongo.ini': No such file or directory

I figured it had something to do with a lot of rackspace mirrors I see in the log, so I did a cat on /etc/apt/sources.list and this is what I found:

deb http://mirror.rackspace.com/ubuntu trusty main restricted deb-src http://mirror.rackspace.com/ubuntu trusty main restricted deb http://mirror.rackspace.com/ubuntu trusty-updates main restricted deb-src http://mirror.rackspace.com/ubuntu trusty-updates main restricted deb http://mirror.rackspace.com/ubuntu trusty universe deb-src http://mirror.rackspace.com/ubuntu trusty universe deb http://mirror.rackspace.com/ubuntu trusty-updates universe deb-src http://mirror.rackspace.com/ubuntu trusty-updates universe deb http://mirror.rackspace.com/ubuntu trusty multiverse deb-src http://mirror.rackspace.com/ubuntu trusty multiverse deb http://mirror.rackspace.com/ubuntu trusty-updates multiverse deb-src http://mirror.rackspace.com/ubuntu trusty-updates multiverse deb http://mirror.rackspace.com/ubuntu trusty-backports main restricted universe multiverse deb-src http://mirror.rackspace.com/ubuntu trusty-backports main restricted universe multiverse

deb http://mirror.rackspace.com/ubuntu trusty-security main restricted deb-src http://mirror.rackspace.com/ubuntu trusty-security main restricted deb http://mirror.rackspace.com/ubuntu trusty-security universe deb-src http://mirror.rackspace.com/ubuntu trusty-security universe deb http://mirror.rackspace.com/ubuntu trusty-security multiverse deb-src http://mirror.rackspace.com/ubuntu trusty-security multiverse

Should I change it somehow?

Thanks!

fideloper's avatar
Level 11

Can you find/location and show the output from the add-apt-repository commands for the various repositories? Often there are issue with importing new repositories, which result in such issues as you pasted here later.

For example, on Vaprobash, I need to set the local to C.UTF-8 before importing the ppa:ondrej/php5 repository, as it uses some UTF8 characters in it's name and elsewhere. The default character on Ubuntu 14.04 used with Vagrant isn't UTF8-friendly. You could be running into that issue on Rackspace.

edgpaez's avatar

Thank you @fideloper !

The problem was that adding the ppa:ondrej/php5 repository resulted in some locale errors. I believe it would be nice if the couple of lines you linked me to were added to the forge script.

I'm now running smoothly on forge :)

Please or to participate in this conversation.