snlpnstslocn
Posts: 2
Joined: Fri Oct 04, 2013 1:56 am

E: Unable to locate package php-cgi

Sat Nov 09, 2013 3:57 pm

Hi All,

I am trying to install lighttpd on raspbmc.

When running the following commandç
sudo apt-get install php5-common php5-cgi php5

the command run but I get the following error message:
E: Unable to locate package php-cgi

what is this due to?

Any help will be much appreciated.

Thanks in advance.

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: E: Unable to locate package php-cgi

Sat Nov 09, 2013 6:37 pm

There is no package called php-cgi.

sudo apt-get install php5-cgi php5-common

should install everything you need.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

snlpnstslocn
Posts: 2
Joined: Fri Oct 04, 2013 1:56 am

Re: E: Unable to locate package php-cgi

Sat Nov 09, 2013 7:55 pm

thank you DougieLawson I am totally new to linux command line your help is highly appreciated.

I re-run the command as you suggested and package got installed. 2 more things:
- when installing this other package I got the following:
sudo apt-get install php5-mysql
[....] Starting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName
(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
failed!

as I understand this is becauae I didn't assign a fqdn into apache configuration. Since I am doing this just to put up a test page for myself can this be the default loopback 127.0.0.1?

- when trying to get into the /www directory I always get the No such file or directory error. What am I missing here?

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: E: Unable to locate package php-cgi

Sat Nov 09, 2013 10:45 pm

You don't need a FQDN, that's optional.

Unless you're doing something special Apache will bind to the 0.0.0.0:80 address/port so http://localhost or http://127.0.0.1 should pull up your index.htm, index.html or index.php page (or the default 404.html if those don't exist).

Have a look in your apache2.conf.
Add (or update) the errorlog directive

Code: Select all

ErrorLog /var/log/apache2/error.log
That should mean any errors during startup get logged.

Then you need to use

Code: Select all

sudo /etc/init.d/apache2 start 
to get the web server started. (If you try that from a non-privileged user you'll get the errors you're reporting.)
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”