Couldn't find package php5-fpm

10,705

Solution 1

For a start, for Ubuntu, you should almost always be using a Long Term Support edition, so that's 10.04.

Here's the reason - https://wiki.ubuntu.com/LTS - look at the graph.

(So if you can wait for 12.04 LTS, due at the end of April, good for you.)

Otherwise, the Nginx' PHP repo - ppa:nginx/php5 - is no longer maintained.

You could use Mercer's repo but he himself says not to (I've just updated vpsbible's stackscripts accordingly, hence the know-how) cos it's not maintained.

INSTEAD ... use the ppa:l-mierzwa/lucid-php5 repo with 10.04 and you'll be fine.

add-apt-repository ppa:l-mierzwa/lucid-php5
apt-get update

(Probably it will be fine with 11.04 also if you want to try.)

That gives you PHP 5.3.10. If you want to play with 5.4.0 (which is not recommended unless you're a bug tester) then this ...

add-apt-repository ppa:ondrej/php5

Solution 2

The PHP-FPM package has only been included in Ubuntu 10.10 (Maverick) and up. If you are running earlier versions of Ubuntu, you will not find it in the official repository.

If you do not wish to upgrade (or are unable to upgrade), you can add another repository that does provide php5-fpm for your distribution.

Some popular choices include:

The nginx/php5 repository (See this answer for details)

sudo aptitude install python-software-properties
sudo add-apt-repository ppa:nginx/php5

Or the Brian Mercer repository (no longer updated!) (as per this HowToForge article).

sudo aptitude install python-software-properties
sudo add-apt-repository ppa:brianmercer/php

I would favour the first one, but perhaps that is a personal preference.

Once you have added the repository:

sudo apt-get update && sudo apt-get install php5-fpm

When using unofficial repositories, be extra diligent that you do not run into any conflicts.

Share:
10,705
Whitey
Author by

Whitey

Updated on September 18, 2022

Comments

  • Whitey
    Whitey almost 2 years

    I'm trying to set up nginx with PHP5 and MySQL on my production VPS. The reason I chose nginx over Apache was because the VPS isn't high spec.

    nginx is installed, and is successfully serving static pages like it should. Now I'm trying to install PHP5 and am running into troubles.

    Following this guide: http://www.zalas.eu/setting-up-a-php-development-environment-with-nginx-on-ubuntu-1104

    it says to run this command to install PHP5:

    sudo apt-get install php5-fpm php5-cli php5-common php5-curl php5-gd \
      php5-mcrypt php5-mysql php5-pgsql php5-sqlite php5-tidy php5-xmlrpc \
      php5-xsl php5-intl php5-imagick php5-xdebug php-apc php-pear
    

    When I do, I get this output:

    root@lvps92-60-122-235:/tmp# sudo apt-get install php5-fpm php5-cli php5-common php5-curl php5-gd \
    >   php5-mcrypt php5-mysql php5-pgsql php5-sqlite php5-tidy php5-xmlrpc \
    >   php5-xsl php5-intl php5-imagick php5-xdebug php-apc php-pear
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package php5-fpm
    

    I've already tried running sudo apt-get update and it still fails. After Google'ing the problem, which usually fixes all trouble I have, there seems to be no fullproof solution :/

    Has anyone done this before and knows how to get PHP5 working properly with nginx?

  • pauska
    pauska over 12 years
    The nginx team has stopped providing php5, and I haven't found any decent alternatives. Just a heads up for those who stumble into this answer.
  • aendra
    aendra about 11 years
    Quality answer.