Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a VPS with Debian GNU/Linux on it. I'm trying to install a PHP file manager so that people could access it and download stuff into a directory.

I don't have anything in my /bin about PHP so this is probably an issue.

I installed PHP with this command:

apt-get install php5 php5-cgi php5-cli php5-gd php5-mysql libapache2-mod-php5

and it says

Reading package lists... Done
Building dependency tree
Reading state information... Done
php5 is already the newest version.
Package php5-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package php5-cgi has no installation candidate

It's saying php is already installed? I try to confirm this by typing php -v and it says

Command php not found

Why is this and how can I get php running?

share|improve this question
    
What version of Debian are you running? –  Tshepang Mar 2 '11 at 10:02
    
I tried your command using Squeeze, and I don't experience your problem. –  Tshepang Mar 2 '11 at 10:03
    
I don't know what you mean by Squeeze –  Kevin Duke Mar 2 '11 at 10:07
    
What version of Debian is that? You might run updatedb and then locate php | grep bin, this should check if there's anything PHP-y installed. –  polemon Mar 2 '11 at 10:08
    
@polemon I'm using debian 5.0 according to my provider but updatedb: command not found –  Kevin Duke Mar 2 '11 at 10:30

2 Answers 2

up vote 2 down vote accepted

Moving that comment to its own answer, looks like your /etc/apt/sources.list is faulty. Edit it to remove the line that contains debian-security, and replace it with

deb http://ftp.nl.debian.org/debian/ lenny main contrib non-free

for the main distribution,

deb http://security.debian.org/ lenny/updates main contrib non-free

for security updates, and

deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free

For so-called 'volatile' updates, then run apt-get update; apt-get -uf upgrade to bring your entire system up to date, and then try installing php5-cgi again.

(ETA: You can replace 'nl' with your own country code to get servers a little closer to your physical location and hopefully better download speeds)

share|improve this answer
    
I don't know which is which so I'm going to just clear everything in that file with what you provided –  Kevin Duke Mar 2 '11 at 10:53
    
Don't clear it out, just insert a # in front of lines to comment them out if you're not sure you may need them later. –  Shadur Mar 2 '11 at 10:54
    
nice, thank you very much; I was able to updated to lated deb (i think) and i downloaded php fine with the command. However, it still says command php not found, do i need to restart my vps? –  Kevin Duke Mar 2 '11 at 11:05
    
actually I'm not 100% sure if it installed, but I think it did` –  Kevin Duke Mar 2 '11 at 11:12
    
The php command-line binary is in the php5-cli package, not php5-cgi. Once you've installed php5-cli the binary should be in /usr/bin/php. –  Shadur Mar 2 '11 at 11:13

What version of Debian is that? You might run updatedb and then locate php | grep bin, this should check if there's anything PHP-y installed.

Also, check if your executable isn't php-cgi or php5-cgi (you need an extra package for the CLI: php5-cli).

In any event, tell us your Debian version.

share|improve this answer
    
-bash: updatedb: command not found –  Kevin Duke Mar 2 '11 at 10:24
    
I'm using debian 5.0 according to my provider –  Kevin Duke Mar 2 '11 at 10:26
    
Have you run apt-get update recently? 5.0 is Lenny, but I still use that on several servers I haven't gotten around to scheduling a full upgrade for, and they have php5-cgi available no problem. shadur@mercury:~$ dpkg -l php5-cgi ii php5-cgi 5.2.6.dfsg.1-1+lenny9 shadur@mercury:~$ cat /etc/debian_version 5.0.8 –  Shadur Mar 2 '11 at 10:37
    
@shadur I ran the update and one of the messages that showed up was W: Failed to fetch http://ftp.debian.org/debian-security/dists/lenny/updates/main/binary-i386/Packa‌​ges 404 Not Found [IP: 130.89.149.226 80] –  Kevin Duke Mar 2 '11 at 10:40
    
anyhow, i just want to install php :( I don't know why this is so difficult. –  Kevin Duke Mar 2 '11 at 10:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.