Udah lama ya tidak menulis blog, sibuk kerja di tempat baru. Servernya kebanyakan Linux Centos. Pada saat tulisan ini dibuat versi PHP versi stable terakhir 5.4.6 akan tetapi, saya memakai php 5.2.6. karena disuruh boss begitu. Ok deh kita mulai saja ya instalasi manual Apache 2.2.22 dan PHP 5.2.6, kalo Mysql nya otomatis saja install pakai YUM:
1. search link download versi apache 2.2.22
2. login sebagai root
3. download :
$ wget http://mirror.cc.columbia.edu/pub/software/apache//httpd/httpd-2.2.22.tar.gz
4. $ tar xfz httpd_2.2.22.tar.gz
5. $ cd /home/indra/httpd_2.2.22/
Kemudian ketik:
./configure --prefix=/usr/local/apache2.2.22 --enable-so --enable-ssl --enable-expires --with-mpm=prefork
--enable-rewrite --enable-deflate --enable-info --enable-headers
# Tips kalau error pada saat make, coba lihat daftar error dan solusi di bagian paling bawah tulisan ini
Kemudian jalankan command-command berikut:
$ make clean
$ make
$ make install
$ /usr/local/apache2.2.22/bin/apachectl -k start
6. download php 5.2.6, save di /home/indra/php5.2.6/ kemudian extract/unzip file dengan command:
$ tar -xvf php-5.2.6.tar.bz2
#ini untuk 32 bit
./configure --prefix=/usr/local/apache2.2.22/php --with-zlib --enable-sigchild --enable-exif --disable-debug --enable-sockets --with-apxs2=/usr/local/apache2.2.22/bin/apxs --with-config-file path=/usr/local/apache2.2.22/php --with-mysqli --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-bz2 --with-curl --enable-mbstring --with-mcrypt
#ini untuk 64 bit
./configure --prefix=/usr/local/apache2.2.22/php --with-zlib --enable-sigchild --enable-exif --disable-debug --enable-sockets --with-apxs2=/usr/local/apache2.2.22/bin/apxs --with-config-file-path=/usr/local/apache2.2.22/php --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
--with-mysqli --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-bz2 --with-curl --enable-mbstring
## --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd dipakai pada php versi 5.3.xx
Kemudian jalankan command-command berikut:
$ make clean
$ make
$ make install
7. Rubah konfigurasi httpd.conf dan php.ini
# You may want to add/usr/local/apache2.2.22/php/lib/php to your php.ini include path
# Jadi kita copy php.ini yang recommended dari folder /home/indra/php5.2.6 ke lokasi php kita.
$ cp php.ini-recommended /usr/local/lib/php.ini
# Edit httpd.conf untuk loading PHP module.
# Biasanya sudah dipasang otomatis pada saat make install
Load PHP 5:
LoadModule php5_module libexec/libphp5.so
#Membuat PHP mem-parse extension tertentu sebagai PHP
$ nano /usr/local/apache2.2.22/conf/httpd.conf
AddType application/x-httpd-php .php .phtml
# Buat file info.php di /usr/local/apache2.2.22/htdocs untuk pengetesan PHP
# /usr/local/apache2.2.22/htdocs adalah default lokasi Document Root Apache 2.2.22
$ nano info.php /usr/local/apache2.2.22/htdocs
#Masukkan kode php berikut dan save menjadi file info.php
<?php
phpinfo();
?>
#buat di /etc/rc.local supaya automatic loading di startup centos
$ nano /etc/rc.local
$ /usr/local/apache2.2.22/bin/apachectl -k start
#disable firewall di centos
$ chkconfig iptables off
#Terakhir install MySQL
$ yum install mysql mysql-server mysql-devel
#automatic loading MySQL di startup centos
$ chkconfig --level 235 mysqld on
=======================================================
DAFTAR ERROR DAN SOLUSI
#Error : no acceptable C compiler found in $PATH
#Solusi: $ yum install gcc
#Error : checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but
#can not be built due to prerequisite failures
#Solusi: $ yum install zlib zlib-devel
#Error :No recognized SSL/TLS toolkit detected
#Solusi: $ yum install -y openssl-devel
#Error : xml2-config not found
#Solusi: $ yum install libxml2 libxml2-devel
#Error : please reinstall the BZip2 distribution
#Solusi: $ yum install bzip2-devel
#Error : Configure: error: Please reinstall the libcurl distribution -
easy.h should be in /include/curl/
#Solusi: $ yum install curl-devel
#Error : Configure: error: libjpeg.(a|so) not found.
#Solusi: $ yum install libjpeg-devel
#Error : Configure: error: libpng.(a|so) not found.
#Solusi: $ yum install libpng-devel
#Error : Configure: error: freetype.h not found.
#Solusi: $ yum install freetype-devel
#mcrypt.h not found. Please reinstall libmycrypt
#Solusi: http://mattiasgeniar.be/2011/11/24/rhel-6-and-centos-6-missing-libmcrypt-and-libmhash-in-default-repository/
# $ rpm -ivh "http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm"
# $ yum install libmcrypt-devel
#Error : mysql_config not found
#Solusi: $ yum install mysql myqsql-server mysql-devel
#Error : /usr.bin/ld find -lltdl
#Error : collect2 : ld returned 1 exit status
#Error : make:*** [libphp5.la] Error 1
#Solusi: $ yum install libtool-ltdl-devel
No comments:
Post a Comment