Difference between revisions of "PhpPgAdmin"

From ArchWiki
Jump to: navigation, search
(English creation of phppgadmin wiki (i use the phpmyadmin wiki to install it on my machine so i do some changes for phppgadmin))
Line 9: Line 9:
Ensure you do not have an older copy of phpMyAdmin.
Ensure you do not have an older copy of phppgadmin.
rm -r /srv/http/phppgAdmin
rm -r /srv/http/phppgAdmin

Revision as of 22:09, 10 April 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی


To install phpPgAdmin, install the phppgadmin packages with

pacman -S phppgadmin


Ensure you do not have an older copy of phppgadmin.

rm -r /srv/http/phppgAdmin

Copy the example configuration file to your httpd configuration directory.

cp /etc/webapps/phppgadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phppgadmin.conf

Add the following lines to Template:Filename:

# phpPgAdmin configuration
Include conf/extra/httpd-phppgadmin.conf

You can type this into the terminal to produce the same effect:

echo -e "\nInclude conf/extra/httpd-phppgadmin.conf" >> /etc/httpd/conf/httpd.conf

Add the following lines to Template:Filename:

# Use for PHP 5.x:
LoadModule php5_module        modules/libphp5.so
AddHandler php5-script php

Add index.php after "DirectoryIndex index.html"

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
<IfModule dir_module>
    DirectoryIndex index.html index.php

In Template:Filename, comment out deny from all. The line should look like this:

#deny from all

Otherwise you'll get an error similar to "Error 403 - Access forbidden!" when you attempt to access your phppgadmin installation.

Your Template:Filename should have the following information:

        Alias /phppgadmin "/usr/share/webapps/phppgadmin"
        <Directory "/usr/share/webapps/phppgadmin">
                AllowOverride All
                Options FollowSymlinks
                Order allow,deny
                Allow from all

Open your Template:Filename and go to the line containing open_basedir and add the path(s) to your phppgAdmin installation so it has the following:


For example, mine contains the following:

open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps

You need the mysql module, so uncomment in Template:Filename:


Accessing your phpPgAdmin installation

Finally your phppgadmin installation is complete. Before start using it you need to restart your apache server by following command:

# /etc/rc.d/httpd restart

You can access your phpmyadmin installation using the following url:


Note: 'localhost' is the hostname in your /etc/rc.conf file.

If you want to access it using:


in '/etc/httpd/conf/extra/httpd-phppgadmin.conf' change:

Alias /phppgadmin/ "/usr/share/webapps/phppgadmin/"


Alias /phppgadmin "/usr/share/webapps/phppgadmin"

Lighttpd Configuration

The php setup for lighttpd is exactly the same as for apache. Make an alias for phppgadmin in your lighttpd config.

 alias.url = ( "/phppgadmin" => "/usr/share/webapps/phppgadmin/")

Then enable mod_alias, mod_fastcgi and mod_cgi in your config ( server.modules section )

Update open_basedir in /etc/php/php.ini and add "/usr/share/webapps/".

 open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/

Make sure lighttpd is setup to serve php files, Lighttpd and FastCGI

Restart lighttpd and browse to http://localhost/phppgadmin/index.php

NGINX Configuration

Also similar to apache configuration (and Lighttpd, for that matter).

Create a symbolic link to the /usr/share/webapps/phppgadmin directory from whichever directory your vhost is serving files from, e.g. /srv/http/<domain>/public_html/

 sudo ln -s /usr/share/webapps/phppgadmin /srv/http/<domain>/public_html/phppgadmin

You can also setup a sub domain with a server block like so (if using php-fpm):

 server {
         server_name     phppgadmin.<domain.tld>;
         access_log      /srv/http/<domain>/logs/phppgadmin.access.log;
         error_log       /srv/http/<domain.tld>/logs/phppgadmin.error.log;
         location / {
                 root    /srv/http/<domain.tld>/public_html/phppgadmin;
                 index   index.html index.htm index.php;
         location ~ \.php$ {
                 root            /srv/http/<domain.tld>/public_html/phppgadmin;
                 fastcgi_pass    unix:/var/run/php-fpm/php-fpm.sock;
                 fastcgi_index   index.php;
                 fastcgi_param   SCRIPT_FILENAME  /srv/http/<domain.tld>/public_html/phppgadmin/$fastcgi_script_name;
                 include         fastcgi_params;