I'm using Ubuntu 11.04 LTS server, it's a new install on a VPS box from MediaTemple (their ve server). I'm trying to install PHP 5.4.3 on this box, but I'm having a common problem not matter what version I get. I'm trying to get the php-cgi process, so I do the command apt-get install php-cgi
and that installs, but does not provide me with the php-cgi
executable. I need this so that I can run php-cgi -b 127.0.0.1:9000
and have it has a FastCGI process for my nginx install. Any idea what I can do to get this to work, bonus points if you can get this to work with PHP 5.4.3, because all I can seem to install is PHP 5.3.5.
1 Answer
I believe the version of PHP5 CGI in Ubuntu 11.04 LTS is,
php5-cgi (5.3.5-1ubuntu7.8) [security]
according to this page. You can check which versions are present in other Ubuntu releases on that page. If you want 5.4.3 you'll either need to find another repository with it in, or download and compile your own version.
It appears you were installing the php5-cli
package which does not contain the relevant php5-cgi binaries.
-
1Also, the name of the executable in the Ubuntu package is
php5-cgi
notphp-cgi
– DerfKJun 7, 2012 at 12:59 -
@DerfK
user@ts:~# apt-get install php5-cli Reading package lists... Done Building dependency tree Reading state information... Done php5-cli is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. user@ts:~# php -v PHP 5.4.3-4~natty+1 (cli) (built: May 17 2012 12:52:08) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies user@ts:~# php5-cli -v -bash: php5-cli: command not found user@ts:~#
Jun 7, 2012 at 19:23 -
@Derfk
user@ve:~# php -v PHP 5.3.5-1ubuntu7.8 with Suhosin-Patch (cli) (built: May 4 2012 00:50:15) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies user@ve:~# php5-cli -v -bash: php5-cli: command not found user@ve:~# php-cli -v -bash: php-cli: command not found user@ve:~#
Jun 7, 2012 at 19:29 -
1@MarkTomlin php-cli does NOT have the CGI interface and can't be used for your fastcgi service. You need the program
php5-cgi
in the packagephp5-cgi
which you have already installed, it's just an older version.– DerfKJun 7, 2012 at 22:39 -
I had to install the php5-cgi, but once I did, everything ways working. Sorry for being so dense. +1 Jun 7, 2012 at 23:06
-V
on the command)? Also, the content of/etc/apt/sources.list
. Lastly, once installed, the output of,dpkg -L php-cgi
.