Thursday, January 18, 2007

Log Instalasi PHP

Posting ini adalah bagian ke tiga dari log proses instalasi sistem web server pada Fedora 5. Lihat posting sebelumnya untuk lebih jelasnya. Pada titik ini telah terinstall Apache dan Postgresql.

File source PHP dapat didownload di http://www.php.net.

1. File source telah diletakkan pada /usr/local/package_install_frsource
[root@localhost postgresql-8.1.4]# cd ..

2. Ekstrak source PHP
[root@localhost package_install_frsource]# tar -xzvf php-5.2.0.tar.gz
.
.
php-5.2.0/CREDITS
php-5.2.0/README.UPDATE_5_2
php-5.2.0/README.UNIX-BUILD-SYSTEM
php-5.2.0/buildconf.bat

3. Konfigurasi PHP dengan terlebih dahulu masuk ke folder php
[root@localhost package_install_frsource]# cd php-5.2.0
[root@localhost php-5.2.0]# ./configure \
> --prefix=/usr/local/apache2/php \
> --with-apxs2=/usr/local/apache2/bin/apxs \
> --disable-cgi \
> --with-config-file-path=/usr/local/apache2/php \
> --with-openssl \
> --with-kerberos \
> --with-zlib \
> --with-bz2 \
> --with-curl \
> --enable-dbase \
> --with-gd \
> --with-pgsql \
> --with-xsl \
> --with-gettext \
> --with-regex=system
.
.
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+

Thank you for using PHP.

4. Compiling
[root@localhost php-5.2.0]# make
.
.
lrt -lpng -lz -lcurl -lbz2 -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lz -lcurl -lssl -lcrypto -ldl -lz -lgssapi_krb5 -lkrb5 -lk5crypto -lkrb5support -lcom_err -lresolv -lidn -lssl -lcrypto -lz -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxslt -lxml2 -lz -lm -lcrypt -o sapi/cli/php

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

[root@localhost php-5.2.0]#

5. Installing
[root@localhost php-5.2.0]# make install
Installing PHP SAPI module: apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/
cp .libs/libphp5.so /usr/local/apache2/modules/libphp5.so
cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /usr/local/package_install_frsource/php-5.2.0/libs'
chmod 755 /usr/local/apache2/modules/libphp5.so
[activating module `php5' in /usr/local/apache2/conf/httpd.conf]
Installing PHP CLI binary: /usr/local/apache2/php/bin/
Installing PHP CLI man page: /usr/local/apache2/php/man/man1/
Installing build environment: /usr/local/apache2/php/lib/php/build/
Installing header files: /usr/local/apache2/php/include/php/
Installing helper programs: /usr/local/apache2/php/bin/
program: phpize
program: php-config
Installing man pages: /usr/local/apache2/php/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /usr/local/apache2/php/lib/php/
[PEAR] Archive_Tar - installed: 1.3.1
[PEAR] Console_Getopt - installed: 1.2
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
[PEAR] PEAR - installed: 1.4.11
Wrote PEAR system config file at: /usr/local/apache2/php/etc/pear.conf
You may want to add: /usr/local/apache2/php/lib/php to your php.ini include_path
Installing PDO headers: /usr/local/apache2/php/include/php/ext/pdo/
[root@localhost php-5.2.0]#

6. Memindahkan file konfigurasi php.ini
[root@localhost php-5.2.0]# cp php.ini-recommended /usr/local/apache2/php/php.ini
[root@localhost php-5.2.0]#
[root@localhost php-5.2.0]# vi /usr/local/apache2/conf/httpd.conf
======
note: Tambahkan beberapa baris berikut pada httpd.conf di sekitar baris 307

AddType application/x-httpd-php .php .html .phtml
AddType application/x-httpd-php-source .phps

Selain itu cek apakah baris berikut ada:
-sekitar baris 53
LoadModule php5_module module/libphp5.so

-sekitar baris 165

DirectoryIndex index.php index.html

======

7. Test hasil instalasi PHP
[root@localhost php-5.2.0]# service apachectl restart
===
note: copy phppgadmin4.0.1 untuk mengecek apakah php sudah bisa dijalankan dan sekaligus untuk mengetahui apakah postgresql dan php kompatibel
sukses phppgadmin muncul dan usertest bisa masuk ke phppgadmin
(*jika terdapat error, cek lagi konfigurasi postgresql /usr/local/pgsql/data/pg_hba.conf dan /usr/local/pgsql/data/postgresql.conf, cek lagi konfigurasi phppgadmin /usr/local/apache2/htdocs/phppgadmin/conf/, dan cek lagi /usr/local/apache2/php/php.ini kemudian restart apache n postgresql. )

=============
[root@localhost php-5.2.0]# /usr/local/apache2/bin/apachectl restart
====
note: jika sepertinya service apachectl masih error. Lakukan perintah restart secara manual seperti perintah di atas
====

No comments: