Just getting started with php, and then start compiling the environment, starting with PostgreSQL...
-----------------------------------------------------------
| System | CentOS 5.7.
-----------------------------------------------------------
If you encounter the dependency issue for compiling postgresql, please post it in a text box.
Yum-y install readline-devel
Refer:
PostgreSQL Download PageHttp://www.postgresql.org/ftp/source/
# Mkdir/usr/local/src/postgresql&&Cd/usr/local/src/postgresql
#Wget http://ftp.postgresql.org/pub/source/v9.1.2/postgresql-9.1.2.tar.gz
Extract
#Tar-zxvf postgresql-9.1.2.tar.gz
# Su--c "useradd-M postgres"
#Chown-R postgres: postgres postgresql-9.1.2
Configure Compilation
#./Configure -- help
#./Configure -- prefix =/opt/pgsql-- Sysconfdir =/opt/pgsql/etc
# Mkdir/Opt/pgsql/Data
# Chown postgres: postgres/opt/pgsql/data
Initialization
# Su ipvs
Bash-3.2 $/opt/pgsql/bin/initdb-D/opt/pgsql/data
[Plain]
- The files belonging to this database system will be owned by user "stored s ".
- This user must also own the server process.
- The database cluster will be initialized with locale en_US.UTF-8.
- The default database encoding has accordingly been set to UTF8.
- The default text search configuration will be set to "english ".
- Fixing permissions on existing directory/opt/pgsql/data... OK
- Creating subdirectories... OK
- Selecting default max_connections... 100
- Selecting default shared_buffers... 32 MB
- Creating configuration files... OK
- Creating template1 database in/opt/pgsql/data/base/1... OK
- Initializing pg_authid... OK
- Initializing dependencies... OK
- Creating system views... OK
- Loading system objects 'descriptions... OK
- Creating collations... OK
- Creating conversions... OK
- Creating dictionaries... OK
- Setting privileges on built-in objects... OK
- Creating information schema... OK
- Loading PL/pgSQL server-side language... OK
- Vacuuming database template1... OK
- Copying template1 to template0... OK
- Copying template1 to copying s... OK
- WARNING: enabling "trust" authentication for local connections
- You can change this by editing pg_hba.conf or using the-A option
- Next time you run initdb.
- Success. You can now start the database server using:
- /Opt/pgsql/bin/postgres-D/opt/pgsql/data
- Or
- /Opt/pgsql/bin/pg_ctl-D/opt/pgsql/data-l logfile start
Add Environment Variables
# Vi/etc/profile
PATH =/opt/pgsql/bin: $ PATH
Export PATH
# Source/etc/profile
Start:
# Mkdir/opt/pgsql/logs/
# Chown postgres: postgres/opt/pgsql/logs/
# Su ipvs
Bash-3.2 $/opt/pgsql/bin/pg_ctl-D/opt/pgsql/data-l/opt/pgsql/logs/pgsql. log start
Set the startup script:
#Su-c"Cp/usr/local/src/postgresql/postgresql-9.1.2/contrib/start-scripts/linux/etc/rc. d/init. d/postgresql-9.1.2"
#Su-c "chmod a + x/etc/rc. d/init. d/postgresql-9.1.2"
#Vi/etc/rc. d/init. d/postgresql-9.1.2