Extending XAMPP with PostgreSQL and phpPgAdmin

offbeatlossData Management

Nov 22, 2012 (4 years and 11 months ago)

1,160 views

Extending XAMPP with PostgreSQL and phpPgAdmin





1

/

19

Extending XAMPP with PostgreSQL and phpPgAdmin
written by
Peter J. Siegel
July 2005, updated November 2005
peter@peter-siegel.de
This paper's intention
XAMPP is a fine adjusted software solution based on Apache Web Server,
MySQL, PHP and Perl. It has been created by the ApacheFriends Project that is
hosted at
http://www.apachefriends.org
. The intention behind the great idea of
creating XAMPP is a preconfigured package that is easy to handle and up-to-
date. It guarantees a minimal waste of time during installation and configuration.
The question which database server should be applied is discussed widely and
even controversially all around the internet. MySQL and PostgreSQL have
different advantages, it seems that they appear to converge to meet somewhere
in the middle. For some time PostgreSQL provides foreign keys, views,
subselects, triggers and stored procedures. MySQL is topping with performance
and a large user base. In actual versions MySQL is adding features like stored
procedures, subselects, etc. while PostgreSQL improves performance and
stability. Nevertheless which database server fits best depends on the
applications that should work with it.
This paper is designed as a short manual that shows how XAMPP could be
extended easily by PostgreSQL and phpPgAdmin. Is has been written during the
setup of my private experimental Web/DBServer. So all described steps have led
to a smooth integration of PostgreSQL into a running system based on XAMPP
and Debian Sarge. This paper is dedicated to anybody who doesn't want to spend
much time searching the web for hints and tips. However, this howto-manual
doesn't raise a claim on completeness. No liability for any loss or damage will be
assumed.
Extending XAMPP with PostgreSQL and phpPgAdmin





2

/

19

pre-requisites
software components
System
Linux, Distribution SuSE 9.1 Personal
Postgre
SQL
Version 8.1.1
RPM Packages:

postgresql-8.1.1-0.1.i586.rpm

postgresql-contrib-8.1.1-0.1.i586.rpm

postgresql-devel-8.1.1-0.1.i586.rpm

postgresql-docs-8.1.1-0.1.i586.rpm

postgresql-libs-8.1.1-0.1.i586.rpm

{postgresql-pl-8.1.1-0.1.i586.rpm}

postgresql-server-8.1.1-0.1.i586.rpm
available at:
ftp://ftp.suse.com/pub/projects/postgresql/postgresql-8.1.1/9.1-i386/
Postgre
SQL
database
modules for
PHP 5
XAMPP 1.5.0 provides a PostgreSQL driver for PHP5 by default.
Normally, no
additional driver libraries need to be installed.
Otherwise, this SuSE 9.3 package has
to be installed:
Version 5.0.3-14
available at:

ftp://search.belnet.be/packages/suse/suse/i386/9.3/suse/i586
Packages:

php5-pgsql-5.0.3-14.i586.rpm
XAMPP
Version 1.5.0
available at
http://www.apachfriends.org
Package:

xampp-linux-1.5.0.tar.gz
phpPgAdmin
Version 4.0.1
available at
http://phppgadmin.sourceforge.net/
Package:

phpPgAdmin--4.0.1.tar.gz
Extending XAMPP with PostgreSQL and phpPgAdmin





3

/

19

Installing XAMPP
The XAMPP 1.5.0 package contains following components:

Apache 2.0.55

MySQL 5.0.15

PHP 4.4.1

PHP 5.0.5

Perl 5.8.7

ProFTPD 1.2.10

phpMyAdmin 2.6.3-pl3

OpenSSL 0.9.8a

GD 2.0.1

Freetype2 2.1.7

libjpeg 6b

libpng 1.2.7

gdbm 1.8.0

zlib 1.2.3

expat 1.2

Sablotron 1.0

libxml 2.4.26

libxslt 1.1.8

Ming 0.2a

Webalizer 2.01

pdf class 009e

ncurses 5.8

mod_perl 2.0.1

FreeTDS 0.63

gettext 0.11.5

IMAP C-Client 2004e

OpenLDAP (client) 2.3.11

mhash library 0.8.18

mcrypt library 2.5.7

cURL 7.13.1

SQLite 2.8.9 (in case of PHP5: 2.8.14)

phpSQLiteAdmin 0.2

eAccelerator 0.9.3

libapreq 2.04-dev

FPDF 1.5.3
Step 1: Install the XAMPP package
Unpack the XAMPP package into the directory '/opt'. An automatically created
subdirectory '/opt/lampp' is filled with the package content. Apply the following
console entry:
# tar xvfz xampp-linux-1.5.0.tar.gz -C '/opt'
Step 2: Create a startup script for XAMPP
The following startup script should be saved into directory '/etc/init.d'. At system
startup, different services are going to be executed by start scripts. These scripts
are originally located in directory '/etc/init.d' and they are registered by a soft
link in at least one run level directory from 'rc0.d' to 'rc6.d'. All soft linked start
scripts in one associated run level directory are called by the entry the run level
master script '/etc/init.d/rc'.
Extending XAMPP with PostgreSQL and phpPgAdmin





4

/

19

Startup script: /etc/init.d/lampp
#! /bin/sh
# Written in 2005 by PJS
#
# Author:
# Peter J. Siegel <peter@peter-siegel.de>, 2005
#
# /etc/init.d/lampp
#
# Description: Start the XAMPP environment
#
### END INIT INFO
XAMPP_DIR=/opt/lampp
case "$1" in

start)
echo "Starting LAMPP"

$XAMPP_DIR/lampp start

;;

stop)
echo "Shutting down LAMPP"

$XAMPP_DIR/lampp stop

;;

restart)

## Stop the service and regardless of whether it was

## running or not, start it again.

$0 stop

$0 start

;;

*)

echo "Usage: $0 {start|stop|restart}"

exit 1

;;
esac
exit 0
Extending XAMPP with PostgreSQL and phpPgAdmin





5

/

19

The start script can be executed automatically on system bootup. This can be set
up with the runlevel editor in YaST:
Extending XAMPP with PostgreSQL and phpPgAdmin





6

/

19

Step 3: Securing XAMPP
Execute following command line:
# /opt/lampp/lampp start
# /opt/lampp/lampp security
An interactive configuration of passwords for XAMPP, MySQL phpMyAdmin and
ProFTPd should be fulfilled with these lines:
XAMPP: Quick security check...
XAMPP: Your XAMPP pages are NOT secured by a password.
XAMPP: Do you want to set a password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Password protection active. Please use 'lampp' as user name!
XAMPP: MySQL is accessable via network.
XAMPP: Normally that's not recommended. Do you want me to turn it off? [yes]
XAMPP: Turned off.
XAMPP: The MySQL/phpMyAdmin user pma has no password set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL pma password
XAMPP: Setting phpMyAdmin's pma password to the new one.
XAMPP: MySQL has no root password set!!!
XAMPP: Do you want to set a password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Setting new MySQL root password.
XAMPP: Change phpMyAdmin's authentication method.
XAMPP: The FTP password is still set to 'lampp'.
XAMPP: Do you want to change the password? [yes]
XAMPP: Password:
XAMPP: Password (again):
XAMPP: Reload ProFTPD...
XAMPP: Done.
Launching the XAMPP page in a web browser under Echnaton's IP address will
show a login window like this:
Extending XAMPP with PostgreSQL and phpPgAdmin





7

/

19

Launching the phpMyAdmin page in a web browser under the server address
"http://192.168.10.3/phpmyadmin" will show a login window like this:
Extending XAMPP with PostgreSQL and phpPgAdmin





8

/

19

Installing PostgreSQL
Step 1: Install the PostgreSQL packages
Installing PostgreSQL from binary packages has advantages over configuring and
compiling source packages. One benefit is an automatically placement of the
server's binaries and shared libraries into standard directories that are 'known'
by the system. No additional file links made by “ldconfig” and no entries in the
configuration file “/etc/ld.so.conf” are needed. With the following described
usage of special RPM packages for SuSE 9.1 all Postgres command line
applications and shared libraries are saved in subdirectories of the system-wide
trusted directories “/usr/bin” and “/usr/lib”. Furthermore, an installation of
different additional libraries and other system software to meet dependencies
can be avoided by usage of fitting packages.

Package installation with "rpm":
# rpm -i postgresql-
8.1.1-0.1.i586.rpm
# rpm -i postgresql-contrib-
8.1.1-0.1.i586.rpm
# rpm -i postgresql-devel-
8.1.1-0.1.i586.rpm
# rpm -i postgresql-docs-
8.1.1-0.1.i586.rpm
# rpm -i postgresql-libs-
8.1.1-0.1.i586.rpm
# rpm -i postgresql-server-
8.1.1-0.1.i586.rpm
Step 2: Create new or adapt existing user 'postgres'
The database administration can be managed by a superuser exclusively. A
superuser as a role owns completely all access rights to the DB server and its
whole stored data content. Within these granted privileges a superuser normally
creates new databases, tables, schemes and users with restricted rights.
Typically, the superuser is equal to a linux user named "postgres" who belongs to
group "postgres". Following steps show the linux console entries for creating or
even changing the specified group and user:
1.
Add a new user group 'postgres'

# groupadd postgres
2.
Create a home directory for user 'postgres'

# mkdir /home/postgres
3.
Create a user 'postgres'

# useradd -g postgres -d /home/postgres/ -p <password> postgres

If user 'postgres' exists

# usermod -g postgres -d /home/postgres/ -p <password> postgres
Extending XAMPP with PostgreSQL and phpPgAdmin





9

/

19

4.
Adjust rights for user 'postgres' allowing access to the home directory

# chown postgres:postgres /home/postgres/
# chmod 700 /home/postgres/
Step 3: Initialize the
Postgre
SQL database
PostgreSQL handles all data in a collection of databases. This collection is a so-
called database cluster and has to be initialized before the server can start
working. An initialization has to be performed with the console program “initdb”.
It attempts to create different directories for the cluster. Be aware that the
superuser has to be the owner of all cluster's directories, simply because he
creates new databases and directories in the cluster. Furthermore, the
PostgreSQL server process is owned by superuser “postgres”.
Switch to user “postgres” with all rights and initialize the database cluster by
following command lines:
# su – postgres
# mkdir /home/postgres/data
# initdb -D /home/postgres/data
With option ”-D“ you can offer a directory that stores the database files and the
data content files, respectively. Following output is printed to console:
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale C.
fixing permissions on existing directory /home/postgres/data ... ok
creating directory /home/postgres/data/global ... ok
creating directory /home/postgres/data/pg_xlog ... ok
creating directory /home/postgres/data/pg_xlog/archive_status ... ok
creating directory /home/postgres/data/pg_clog ... ok
creating directory /home/postgres/data/pg_subtrans ... ok
creating directory /home/postgres/data/pg_twophase ... ok
creating directory /home/postgres/data/pg_multixact/members ... ok
creating directory /home/postgres/data/pg_multixact/offsets ... ok
creating directory /home/postgres/data/base ... ok
creating directory /home/postgres/data/base/1 ... ok
creating directory /home/postgres/data/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1000
creating configuration files ... ok
creating template1 database in /home/postgres/data/base/1 ... ok
initializing pg_authid ... ok
enabling unlimited row size for system tables ... ok
initializing dependencies ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built­in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
Extending XAMPP with PostgreSQL and phpPgAdmin





10

/

19

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the ­A option the
next time you run initdb.
Success. You can now start the database server using:
    
postmaster ­D /home/postgres/data
or
    
pg_ctl ­D /home/postgres/data ­l logfile start
If these possible errors rise up:
1.
initdb: error while loading shared libraries: libssl.so.4: cannot open shared
object file: No such file or directory
Solution:
# ln -s /usr/lib/libssl.so.0.9.7 /usr/lib/libssl.so.4
2.
initdb: error while loading shared libraries: libcrypto.so.4: cannot open
shared object file: No such file or directory
Solution:
# ln -s /usr/lib/libcryto.so.0.9.7 /usr/lib/libcrypto.so.4
3.
initdb: error while loading shared libraries: libtermcap.so.2: cannot open
shared object file: No such file or directory
Solution:

Download and install the basic system library for accessing the
termcap database
(
ftp://search.belnet.be/packages/suse/suse/i386/9.3/suse/i586/termcap-2.0.8-876.i586.rpm
)

# rpm -i libtermcap-2.0.8-876.i586.rpm
Extending XAMPP with PostgreSQL and phpPgAdmin





11

/

19

Step 4: The
Postgre
SQL start script
The following bash script starts the PostgreSQL database server at boot time.
The script has to be placed into directory „/etc/init.d/“ with the access property
code „rwxr-xr-x“ (chmod 755) for user “root”.
#!/bin/bash
# postgreSQL – start script
#
# annotations
# * "/home/postgres/logfile" is the server log, no directory
# * all environment variables have to be exported explicitly because the
# configuration file “/etc/profile” will be loaded later
# * the command line construct "su postgres -c '.....' " guarantees that user “root”
# can start or stop the server without any error. By default, the PostgreSQL server can
# only be started and stopped by superuser “postgres”
export

PGBIN=
/usr/bin/
export

PGDATA=
/home/postgres/data
case

"
$1
"

in


start
)

echo
Starting PostgreSQL

su
postgres -c
'$PGBIN/pg_ctl -s -D $PGDATA -l /home/postgres/logfile start'


;;

stop
)

echo
Shutting down PostgreSQL

su
postgres -c
'$PGBIN/pg_ctl stop'


;;

restart
)


$0
stop

$0
start

;;


reload
)

su
postgres -c
'$PGBIN/pg_ctl -s -D $PGDATA -l /home/postgres/logfile reload'

;;

*
)

echo

"Usage:
$0
{start | stop | restart | reload}"


;;

esac
exit
0
Step 5: Configuring access rights to
Postgre
SQL database
Granting client based access depends on entries in file “/etc/hosts.allow” in the
server's system. It contains configurations about which client machine should be
able to access explicitly named services. Pay attention to grant defined clients to
your database server machine. For example, following entry in file
“/etc/hosts.allow” allows SSH access for a client:
# allow ssh access for client 192.168.0.1
ssh sshd : 192.168.0.1 : ALLOW
Check the file “/etc/services” these entries that open port 5432 for accessing the
PostgreSQL database server:
Extending XAMPP with PostgreSQL and phpPgAdmin





12

/

19

postgresql 5432/tcp # PostgreSQL Database
postgresql 5432/udp # PostgreSQL Database

There are different ways a PostgreSQL database server can be accessed. Two
possible configurations are described in the following track:
Access directly from a client via port 5432
Consider a client running pgAdmin III. Some entries in the PostgreSQL
configuration files are needed for granting access to a PostgreS
QL database
server:
Modifications in file “postgresql.conf” (server related connection settings)
#---------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#---------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '192.168.10.3'

# what IP interface(s) to listen on;

# defaults to localhost, '*' = any
port = 5432
The connection settings above belong to the
server
on which the Postgres
database is running. For example, the database server should be accessed by
connections on a built in network interface card that is configured with IP
address 192.168.10.3. All database connections are passing port 5432.
Modifications in file “pg_hba.conf” (client related connection settings)
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all
192.168.10.1/32
trust
# IPv6 local connections:
host all all ::1/128 trust
Change the valid address for Ipv4 connections to the
client's
IP that is granted
to access the database.
Extending XAMPP with PostgreSQL and phpPgAdmin





13

/

19

Access from a client via phpPgAdmin (Port 80)
Consider a server running the web based administration tool “phpPgAdmin”.
Because phpPgAdmin runs on the server itself, all accesses to PostgreSQL are
performed by “localhost” (IP 127.0.0.1). All accessing clients are directed
through a web server (Apache) on port 80. Because all queries are directed by
an Apache web server on the same machine, only localhost needs to be granted
database access.
Some entries in the PostgreSQL configuration files are needed for granting
access to a PostgreS
QL database server:
Modifications in file “pg_hba.conf”
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all
127.0.0.1/32
trust
# IPv6 local connections:
host all all ::1/128 trust
Change the valid address for Ipv4 connections to the localhost IP 127.0.0.1.
Modifications in file “postgresql.conf”
#---------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#---------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '
localhost
'

# what IP interface(s) to listen on;

# defaults to localhost, '*' = any
port = 5432
Change the connection settings above to the given values.
Step 6: Install the
Postgre
SQL database modules for PHP
XAMPP 1.5.0 provides a PostgreSQL driver for PHP5 by default. No additional
driver libraries need to be installed.
Extending XAMPP with PostgreSQL and phpPgAdmin





14

/

19

Step 7: Install and configure the phpPgAdmin package
1
st
:
Unpack the phpPgAdmin package into the directory '/opt/lampp'. An
automatically created subdirectory '/opt/lampp/phppgadmin' is filled with the
package content. Apply the following console entry:
# tar xvfz
phpPgAdmin-4.0.1.tar.gz
-C '/opt/lampp'
2
nd
:
Create a link to the shared object library that belongs to the PostgreSQL
driver for PHP5. In XAMPP 1.5.0 a PostgreSQL driver for PHP 5 is provided
in directory for PHP extensions “
/opt/lampp/lib/php/extensions/no-debug-
non-zts-20041030”
. A
link to the Postgres-PHP driver is expected in the
system directory “/usr/lib/php5/extensions”.

Apply the following console
entry for creating an appropriate link:
# ln -s /opt/lampp/lib/php/extensions/no-debug-non-zts-20041030/pgsql.so
/usr/lib/php5/extensions/pgsql.so
3
rd
:
Edit the PHP configuration file at “/opt/lampp/etc/php.ini”. Add the
PostgreSQL driver extension for PHP at the paragraph “dynamic
extensions”. You can add these lines:
; PostgreSQL library for phpPgAdmin
extension=pgsql.so
In XAMPP 1.5.0 this extension entry is active by default.
4
th
: Edit the configuration file for your PostgreSQL database cluster at
“/home/postgres/data/postgresql.conf”. Set the properties for database
access through a network. Make sure that the connection settings
correspond with these values:
listen_adresses = 'localhost' # ip settings to listen on;

# defaults to localhost
port = 5432
Extending XAMPP with PostgreSQL and phpPgAdmin





15

/

19

5
th
:
Edit the PostgreSQL client authentication configuration file at
“/home/postgres/data/pg_hba.conf”. The properties in this file control which
clients are allowed to connect and how they should authenticate themselves.
Set the following properties:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 trust
You should pay attention to the settings for local connections from localhost.
Set the authentication method to “md5”, otherwise phpPgAdmin doesn't
verify any password for logins of superuser “postgres”. That means anybody
can login as superuser without giving any password.
6
th
:
The configuration file for phpPgAdmin “config.inc.php” is located in
directory “/opt/lampp/phpPgAdmin/conf”. It should look like this:
<?php
/**

* Central phpPgAdmin configuration. As a user you may modify the

* settings here for your particular configuration.

*

* $Id: config.inc.php-dist,v 1.35.2.2 2005/02/11 11:23:39 chriskl Exp $

*/
// An example server. Create as many of these as you wish,
// indexed from zero upwards.
// Display name for the server on the login screen
$conf['servers'][0]['desc'] = 'PostgreSQL';
// Hostname or IP address for server. Use '' for UNIX domain socket.
$conf['servers'][0]['host'] = '127.0.0.1';
// pjs
// Database port on server (5432 is the PostgreSQL default)
$conf['servers'][0]['port'] = 5432;
// Change the default database only if you cannot connect to template1
$conf['servers'][0]['defaultdb'] = 'template1';
// Specify the path to the database dump utilities for this server.
// You can set these to '' if no dumper is available.
$conf['servers'][0]['pg_dump_path'] = '/usr/bin/pg_dump';
$conf['servers'][0]['pg_dumpall_path'] = '/usr/bin/pg_dumpall';
// Default language for the login screen if there's no translation
// matching user's browser request. Eg: 'english', 'polish', etc.
$conf['default_lang'] = 'english';
Extending XAMPP with PostgreSQL and phpPgAdmin





16

/

19

// If extra login security is true, then logins via phpPgAdmin with no
// password or certain usernames (pgsql, postgres, root, administrator)
// will be denied. Only set this false once you have read the FAQ and
// understand how to change PostgreSQL's pg_hba.conf to enable
// passworded local connections.
$conf['extra_login_security'] = false;
// pjs
// Only show owned databases?
// Note: This will simply hide other databases in the list - this does
// not in any way prevent your users from seeing other database by
// other means. (eg. Run 'SELECT * FROM pg_database' in the SQL area.)
$conf['owned_only'] = false;
// Display comments on objects? Comments are a good way of documenting
// a database, but they do take up space in the interface.
$conf['show_comments'] = true;
// Display "advanced" objects? Setting this to true will show types,
// operators conversions, languages and casts in phpPgAdmin. These
// objects are rarely administered and can clutter the interface.
$conf['show_advanced'] = false;
// Display "system" objects?
$conf['show_system'] = false;
// Display reports feature? For this feature to work, you must
// install the reports database as explained in the INSTALL file.
$conf['show_reports'] = true;
// Only show owned reports?
// Note: This does not prevent people from accessing other reports by
// other means.
$conf['owned_reports_only'] = false;
// Minimum length users can set their password to.
$conf['min_password_length'] = 1;
// Width of the left frame in pixels (object browser)
$conf['left_width'] = 200;
// Which look & feel theme to use
$conf['theme'] = 'default';
// Show OIDs when browsing tables?
$conf['show_oids'] = false;
// Max rows to show on a page when browsing record sets
$conf['max_rows'] = 30;
// Max chars of each field to display by default in browse mode
$conf['max_chars'] = 50;
// Send XHTML headers? Unless debugging, it's best to leave this off
$conf['use_xhtml'] = false;
/*****************************************

* Don't modify anything below this line *

*****************************************/
$conf['version'] = 13;
?>
Extending XAMPP with PostgreSQL and phpPgAdmin





17

/

19

7
th
:
If you get error messages like those:
Warning
: session_start() [
function.session-start
]: open(/tmp/sess_a707c754040a78eae2205da7ca74a140, O_RDWR)
failed: Keine Berechtigung (13) in
/opt/lampp/phpPgAdmin/libraries/lib.inc.php
on line
77
Warning
: session_start() [
function.session-start
]: Cannot send session cookie - headers already sent by (output
started at /opt/lampp/phpPgAdmin/libraries/lib.inc.php:77) in
/opt/lampp/phpPgAdmin/libraries/lib.inc.php
on
line
77
Warning
: session_start() [
function.session-start
]: Cannot send session cache limiter - headers already sent
(output started at /opt/lampp/phpPgAdmin/libraries/lib.inc.php:77) in
/
opt/lampp/phpPgAdmin/libraries/lib.inc.php
on line
77
You should load the file “/opt/lampp/phpPgAdmin/libraries/lib.inc.php” with
an editor and change the following section
// Start session (if not auto-started)
if (!ini_get('session.auto_start')) {

session_name('PPA_ID');

session_start();
}
and add a directory with public access like it's shown here:

// Start session (if not auto-started)
if (!ini_get('session.auto_start')) {

session_name('
/tmp/
PPA_ID');

session_start();
}
The directory “/tmp” is the default location for saving sessions in PHP. It's
appropriate entry can be found in configuration file “/opt/lampp/etc/php.ini”,
parameter “session.save_path”.
8
th
:
If you get error messages like those:
Warning
: session_start() [
function.session-start
]: open(/tmp/sess_a707c754040a78eae2205da7ca74a140, O_RDWR)
failed: Keine Berechtigung (13) in
/opt/lampp/phpPgAdmin/logout.php
on line
11
Warning
: session_start() [
function.session-start
]: Cannot send session cookie - headers already sent by (output
started at /opt/lampp/phpPgAdmin/logout.php:11) in
/opt/lampp/phpPgAdmin/logout.php
on line
11
Warning
: session_start() [
function.session-start
]: Cannot send session cache limiter - headers already sent
(output started at /opt/lampp/phpPgAdmin/logout.php:11) in
/opt/lampp/phpPgAdmin/logout.php
on line
11
Warning
: session_destroy() [
function.session-destroy
]: Session object destruction failed in
/
opt/lampp/phpPgAdmin/logout.php
on line
14
Warning
: Cannot modify header information - headers already sent by (output started at /
opt/lampp/phpPgAdmin/logout.php:11) in
/opt/lampp/phpPgAdmin/logout.php
on line
16
Extending XAMPP with PostgreSQL and phpPgAdmin





18

/

19

You should load the file “/opt/lampp/phpPgAdmin/logout.php” with an editor
and change the following section
if (!ini_get('session.auto_start')) {

session_name('PPA_ID');

session_start();
}
and add a directory with public access like it's shown here:
if (!ini_get('session.auto_start')) {

session_name('
/tmp/
PPA_ID');

session_start();
}
9
th
:
The changes made in steps 7
th
and 8
th
can be replaced by a change in the
PHP configuration file “/opt/lampp/etc/php.ini”:
Switch the value for “session.auto_start” from 0 to 1.
; Initialize session on request startup.
session.auto_start =
0
10
th
:
Finally edit some settings to Apache web server's configuration file at
location “/opt/lampp/etc/httpd.conf”. Some XAMPP versions point to a
second configuration file (“/opt/lampp/etc/extra/httpd-xampp.conf”) that is
loaded in “httpd.conf”. The additional settings refer to section

3 (virtual
hosts). First, Apache needs an extension which is added to the host URL. By
that extension the phpPgAdmin is called remotely. This is achieved by
following settings:
# Alias for phpPgAdmin
# added by PJS
Alias /phpPgAdmin "/opt/lampp/phpPgAdmin"
<Directory "/opt/lampp/phpPgAdmin">

AllowOverride AuthConfig Limit
</Directory>
The alias maps an URL-extension to the application directory where
phpPgAdmin is installed.
Furthermore, make sure that the following line is part of “httpd.conf”. It tells
Apache how to handle client requests with PHP-suffixes.
AddType application/x-httpd-php .php .php3 .php4
Normally, this line exists by default since XAMPP 1.0.
Extending XAMPP with PostgreSQL and phpPgAdmin





19

/

19