Compiling PHP 5 from source on FreeBSD 7

source http://pvpgn.imigi.ro/index.php/Install_apache_httpd_with_php_support
http://www.php.net/manual/en/install.unix.apache2.php
————————————————————————————————
This is a quick simple guide how to compile php-5.2.6 from source on FreeBSD 7.0

First we need to download the source file from

# cd /usr/local/src
# wget -c http://id2.php.net/get/php-5.2.6.tar.gz/from/this/mirror
# tar xvfz php-5.2.6.tar.gz
# cd php-5.2.6

Sebelumnya pastikan bahwa paket berikut udah terinstal lewat sysinstall ato pake pkg_add.
gd
libiconv
libxml2
libxslt
perl
png
libmcrypt

# ./configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –with-mysql=/usr/local/mysql –enable-fastcgi –enable-calendar –enable-bcmath –enable-exif –enable-mbstring –with-gettext –with-gd –with-pear –with-mcrypt

# make

Once compiled correctly with no errors we need to make install

# make install

Salin php.ini-recommended ke folder php/lib.
# cp php.ini-recommended /usr/local/php/lib/php.ini

Tambahkan directory /usr/local/php/include pada php.ini dibagian include_path
include_path = “.:/usr/local/php/include”

Apabila ada tambahan konfigurasi bisa edit langsung file /usr/local/php/lib/php.ini

Ubah konfigurasi file apache.
# ee /usr/local/apache2/conf/httpd.conf

Lalu pastikan dan tambahkan entry-an berikut kedalam file konfigurasi apache.
LoadModule php5_module modules/libphp5.so
# lihat seperti contoh di web ini http://www.php.net/manual/en/install.unix.apache2.php
# allow .php, .php2, .php3, .php4, .php5, .php6, and .phtml files to be executed as PHP
SetHandler application/x-httpd-php
# allow .phps files to be executed as PHP source files
SetHandler application/x-httpd-php-source

Lalu ubah entry-an berikut.

DirectoryIndex index.html

Menjadi.

DirectoryIndex index.php index.html

Now that is all done we are ready to restart Apache 2.
# cd /usr/local/apache2
# bin/apachectl restart

Apabila ada tambahan konfigurasi bisa edit langsung file conf/httpd.conf
Untuk mencoba script PHP, buat file index.php dengan contoh berikut.
# ee /usr/local/apache2/htdocs/index.php

Isikan dengan entry-an berikut.

Simpan, lalu buka browser dan arahkan ke http://localhost
Apabila berhasil, maka akan muncul phpinfo

Untuk meng-enable kan tag dapat mengubah isi file /usr/local/php/lib/php.ini
short_open_tag = Off

Menjadi.
short_open_tag = On

Lalu restart apache nya kembali.
# cd /usr/local/apache2
# bin/apachectl restart

And we are done!

Thanks tuk wimbo atas bantuannya 😛
Aturrr dahhhh

Iklan
Ditulis dalam Tutorial. 1 Comment »

Satu Tanggapan to “Compiling PHP 5 from source on FreeBSD 7”

  1. wimbo Says:

    PERTAMAX hehehehe
    wew ada namaku disini jadi tersungging gw


Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: