4

I'm trying to setup a nginx+postgresql testing server,but when i try to install phppgadmin it tries to install apache2, I don't want to install apache2, is there a way to install it without apache?

0xC0000022L
  • 5,656
  • 6
  • 52
  • 91
Chris Gomez
  • 151
  • 1
  • 5

2 Answers2

4

As the package shows (apt-cache show phppgadmin):

Depends: libapache2-mod-php5 | php5-cgi, php5-pgsql, apache2 | httpd, libjs-jquery

the package depends on apache2 or httpd. It will favor apache2. So, just pass nginx explicitly and it should install, because nginx offers httpd (see output of apt-cache showpkg httpd).

$ apt-cache showpkg httpd|grep nginx
nginx-naxsi 1.4.6-1ubuntu3
nginx-light 1.4.6-1ubuntu3
nginx-full 1.4.6-1ubuntu3
nginx-extras 1.4.6-1ubuntu3
nginx-core 1.4.6-1ubuntu3

Edit:

Tried this myself on Ubuntu 14.04 just to find out that it doesn't work. Apparently one of the dependencies is hardcoded and not tied to httpd only. Presumably because no configuration exists for anything other than Apache? Anyway, I set out to find out and it turns out the Depends line from above holds the key. It's not just apache2 | httpd but also libapache2-mod-php5 | php5-cgi. So we need to be explicit about these things as well.

The package apt-rdepends shows what's going on:

$ apt-rdepends phppgadmin|grep apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
  Depends: apache2
  Depends: libapache2-mod-php5
apache2
  Depends: apache2-bin (= 2.4.7-1ubuntu4)
  Depends: apache2-data (= 2.4.7-1ubuntu4)
apache2-bin
apache2-data
libapache2-mod-php5
  Depends: apache2 (>= 2.4)
  Depends: apache2-api-20120211
apache2-api-20120211

The libapache2-mod-php5 line is also to be found in the dependencies of phppgadmin and is the issue here.

Therefore we end up with:

$ apt-get install --no-install-recommends nginx php5-cgi phppgadmin
0xC0000022L
  • 5,656
  • 6
  • 52
  • 91
1

You don't need apt to install phppgadmin.

Download the compressed folder from sourceforge and unzip into your root (or into a folder that you symlink into your root).
That's all you need to be up and running. Some points that might help:

  • PhpPgAdmin requires another user besides postgres. In Linux:
    $ sudo -u postgres createuser --superuser --pwprompt dev
  • If you get login failed, you probably are connected over Unix socket.
    Edit pg_hba.conf (/etc/postgresql/9.x/main/pg_hba.conf).
    Replace local all all peer with local all all md5
  • If you get a 403 error, then phppgadmin was probably unzipped as root.
    Change the user to www-data: sudo chown -R www-data phppgadmin
  • The detailed install instructions can be found here, and common issues here.

Using --no-install-recommends as 0xC0000022L suggested does not work, as Apache is a dependency, not a recommendation.
He correctly explained the issue, though. If you use apt, the install will probably work, it just will install Apache and then err out when Apache is unable to run.

SamGoody
  • 179
  • 1
  • 6
  • Using --no-install-recommends works on Ubuntu 14.04 - only php5-cgi, php5-pgsql and phppgadmin were installed in my case. – Marek Jul 29 '15 at 22:36
  • @SamGoody: you are wrong. The main point is **not** to use `--no-install-recommends` (and my answer does not imply that). The main point is that the dependency is `apache2 | httpd` and that `nginx` *provides* `httpd`. And equally that we can use either the favored `libapache2-mod-php5` which will *again* try to pull `apache2` in or explicitly ask for `php5-cgi` So by installing `nginx php5-cgi` explicitly we sidestep the installation of `apache2` which would otherwise be favored (unless another `httpd` "provider" is already installed). It really is as simple as that. – 0xC0000022L Jul 29 '15 at 22:58