
galihrezah.blogspot.com -
Dengan PHP-FPM, proses kerja dari script PHP akan lebih efektif jika dibandingkan dengan menggunakan PHP konvensional. Dan tentunya akan lebih hemat resource
1. Aktifkan REMI Repository di VPS anda
Karena secara default PHP-FPM bukan bagian dari package dari CentOS maka kita harus menggunkan REMI Repository agar bisa install PHP-FPM secara langsung. Untuk mendapatkan dan menginstallnya, gunakan cara di bawah ini dan sesuaikan dengan veris CentOS yang anda gunakan. Pada contoh ini saya menggunakan CentOS 6 32 bit
ketikan perintah
wget http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/5/remi/i386/remi-release-5-9.el5.remi.noarch.rpm
rpm -Uvh remi-release-5-9.el5.remi.noarch.rpm

wget http://rpms.famillecollet.com/enterprise/5/remi/i386/remi-release-5-8.el5.remi.noarch.rpm
rpm -Uvh remi-release-5-8.el5.remi.noarch.rpm
yum update

rpm di dapat dari
http://rpms.famillecollet.com/enterprise/5/remi/i386/repoview/remi-release.html
2. Install dan Konfigurasi PHP-FPM
Setelah REMI sudah aktif di VPS anda, lanjutkan dengan install PHP-FPM dan paket lain yang diperlukan
yum --enablerepo=remi install php-fpm php-mysql php-gd php-pear php-mbstring php-common php-pdo php-xml php-cli php-mcrypt
rpm -qa | grep -i php
service php-fpm start

hasil di vps saya seperti ini
[root@galihreza ~]# yum --enablerepo=remi install php-fpm php-mysql php-gd php-p
ear php-mbstring php-common php-pdo php-xml php-cli php-mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.plusline.de
* epel: mirror.de.leaseweb.net
* extras: ftp.plusline.de
* remi: mirror5.layerjet.com
* updates: ftp.plusline.de
remi | 2.9 kB 00:00
remi/primary_db | 498 kB 00:06
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-cli.i686 0:5.4.13-1.el6.remi will be installed
---> Package php-common.i686 0:5.4.13-1.el6.remi will be installed
---> Package php-fpm.i686 0:5.4.13-1.el6.remi will be installed
---> Package php-gd.i686 0:5.4.13-1.el6.remi will be installed
--> Processing Dependency: libt1.so.5 for package: php-gd-5.4.13-1.el6.remi.i686
--> Processing Dependency: libXpm.so.4 for package: php-gd-5.4.13-1.el6.remi.i68
6
--> Processing Dependency: libX11.so.6 for package: php-gd-5.4.13-1.el6.remi.i68
6
---> Package php-mbstring.i686 0:5.4.13-1.el6.remi will be installed
---> Package php-mcrypt.i686 0:5.4.13-1.el6.remi will be installed
--> Processing Dependency: libmcrypt.so.4 for package: php-mcrypt-5.4.13-1.el6.r
emi.i686
---> Package php-mysql.i686 0:5.4.13-1.el6.remi will be installed
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18) for package:
php-mysql-5.4.13-1.el6.remi.i686
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_16) for package:
php-mysql-5.4.13-1.el6.remi.i686
--> Processing Dependency: libmysqlclient.so.18 for package: php-mysql-5.4.13-1.
el6.remi.i686
---> Package php-pdo.i686 0:5.4.13-1.el6.remi will be installed
---> Package php-pear.noarch 1:1.9.4-12.el6.remi.1 will be installed
---> Package php-xml.i686 0:5.4.13-1.el6.remi will be installed
--> Running transaction check
---> Package libX11.i686 0:1.5.0-4.el6 will be installed
--> Processing Dependency: libX11-common = 1.5.0-4.el6 for package: libX11-1.5.0
-4.el6.i686
--> Processing Dependency: libxcb.so.1 for package: libX11-1.5.0-4.el6.i686
---> Package libXpm.i686 0:3.5.10-2.el6 will be installed
---> Package libmcrypt.i386 0:2.5.7-5.el5 will be installed
---> Package mysql-libs.i686 0:5.5.30-1.el6.remi will be installed
---> Package t1lib.i686 0:5.1.2-6.el6_2.1 will be installed
--> Running transaction check
---> Package libX11-common.noarch 0:1.5.0-4.el6 will be installed
---> Package libxcb.i686 0:1.8.1-1.el6 will be installed
--> Processing Dependency: libXau.so.6 for package: libxcb-1.8.1-1.el6.i686
--> Running transaction check
---> Package libXau.i686 0:1.0.6-4.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php-cli i686 5.4.13-1.el6.remi remi 2.6 M
php-common i686 5.4.13-1.el6.remi remi 898 k
php-fpm i686 5.4.13-1.el6.remi remi 1.4 M
php-gd i686 5.4.13-1.el6.remi remi 138 k
php-mbstring i686 5.4.13-1.el6.remi remi 937 k
php-mcrypt i686 5.4.13-1.el6.remi remi 47 k
php-mysql i686 5.4.13-1.el6.remi remi 127 k
php-pdo i686 5.4.13-1.el6.remi remi 113 k
php-pear noarch 1:1.9.4-12.el6.remi.1 remi 376 k
php-xml i686 5.4.13-1.el6.remi remi 162 k
Installing for dependencies:
libX11 i686 1.5.0-4.el6 base 590 k
libX11-common noarch 1.5.0-4.el6 base 192 k
libXau i686 1.0.6-4.el6 base 24 k
libXpm i686 3.5.10-2.el6 base 50 k
libmcrypt i386 2.5.7-5.el5 epel 124 k
libxcb i686 1.8.1-1.el6 base 114 k
mysql-libs i686 5.5.30-1.el6.remi remi 775 k
t1lib i686 5.1.2-6.el6_2.1 base 152 k
Transaction Summary
================================================================================
Install 18 Package(s)
Total download size: 8.7 M
Installed size: 32 M
Is this ok [y/N]: y
Is this ok [y/N]: y
Downloading Packages:
(1/18): libX11-1.5.0-4.el6.i686.rpm | 590 kB 00:06
(2/18): libX11-common-1.5.0-4.el6.noarch.rpm | 192 kB 00:01
(3/18): libXau-1.0.6-4.el6.i686.rpm | 24 kB 00:00
(4/18): libXpm-3.5.10-2.el6.i686.rpm | 50 kB 00:00
(5/18): libmcrypt-2.5.7-5.el5.i386.rpm | 124 kB 00:01
(6/18): libxcb-1.8.1-1.el6.i686.rpm | 114 kB 00:01
(7/18): mysql-libs-5.5.30-1.el6.remi.i686.rpm | 775 kB 00:10
(8/18): php-cli-5.4.13-1.el6.remi.i686.rpm | 2.6 MB 00:36
(9/18): php-common-5.4.13-1.el6.remi.i686.rpm | 898 kB 00:12
(10/18): php-fpm-5.4.13-1.el6.remi.i686.rpm | 1.4 MB 00:16
(11/18): php-gd-5.4.13-1.el6.remi.i686.rpm | 138 kB 00:01
(12/18): php-mbstring-5.4.13-1.el6.remi.i686.rpm | 937 kB 00:12
(13/18): php-mcrypt-5.4.13-1.el6.remi.i686.rpm | 47 kB 00:00
(14/18): php-mysql-5.4.13-1.el6.remi.i686.rpm | 127 kB 00:01
(15/18): php-pdo-5.4.13-1.el6.remi.i686.rpm | 113 kB 00:01
(16/18): php-pear-1.9.4-12.el6.remi.1.noarch.rpm | 376 kB 00:05
(17/18): php-xml-5.4.13-1.el6.remi.i686.rpm | 162 kB 00:02
(18/18): t1lib-5.1.2-6.el6_2.1.i686.rpm | 152 kB 00:03
--------------------------------------------------------------------------------
Total 73 kB/s | 8.7 MB 02:02
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Importing GPG key 0x00F97F56:
Userid : Remi Collet
Package: remi-release-5-9.el5.remi.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Is this ok [y/N]: y
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 217521f6: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Importing GPG key 0x217521F6:
Userid : Fedora EPEL
Package: epel-release-5-4.noarch (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : php-common-5.4.13-1.el6.remi.i686 1/18
WARNING : These php-* RPM are not official Fedora/Redhat build and
overrides the official ones. Don't file bugs on Fedora Project nor Redhat.
Use dedicated forums http://forums.famillecollet.com/
Installing : php-pdo-5.4.13-1.el6.remi.i686 2/18
Installing : php-cli-5.4.13-1.el6.remi.i686 3/18
Installing : libX11-common-1.5.0-4.el6.noarch 4/18
Installing : mysql-libs-5.5.30-1.el6.remi.i686 5/18
WARNING : This MySQL RPM is not an official Fedora / Red Hat build and it
overrides the official one. Don't file bugs on Fedora Project nor Red Hat.
Use dedicated forums http://forums.famillecollet.com/
Installing : libXau-1.0.6-4.el6.i686 6/18
Installing : libxcb-1.8.1-1.el6.i686 7/18
Installing : libX11-1.5.0-4.el6.i686 8/18
Installing : t1lib-5.1.2-6.el6_2.1.i686 9/18
Installing : libXpm-3.5.10-2.el6.i686 10/18
Installing : libmcrypt-2.5.7-5.el5.i386 11/18
Installing : php-mcrypt-5.4.13-1.el6.remi.i686 12/18
Installing : php-gd-5.4.13-1.el6.remi.i686 13/18
Installing : php-mysql-5.4.13-1.el6.remi.i686 14/18
Installing : 1:php-pear-1.9.4-12.el6.remi.1.noarch 15/18
Installing : php-mbstring-5.4.13-1.el6.remi.i686 16/18
Installing : php-xml-5.4.13-1.el6.remi.i686 17/18
Installing : php-fpm-5.4.13-1.el6.remi.i686 18/18
Verifying : php-mbstring-5.4.13-1.el6.remi.i686 1/18
Verifying : php-pdo-5.4.13-1.el6.remi.i686 2/18
Verifying : 1:php-pear-1.9.4-12.el6.remi.1.noarch 3/18
Verifying : php-gd-5.4.13-1.el6.remi.i686 4/18
Verifying : php-mysql-5.4.13-1.el6.remi.i686 5/18
Verifying : t1lib-5.1.2-6.el6_2.1.i686 6/18
Verifying : libX11-1.5.0-4.el6.i686 7/18
Verifying : libmcrypt-2.5.7-5.el5.i386 8/18
Verifying : libXau-1.0.6-4.el6.i686 9/18
Verifying : php-xml-5.4.13-1.el6.remi.i686 10/18
Verifying : php-cli-5.4.13-1.el6.remi.i686 11/18
Verifying : libX11-common-1.5.0-4.el6.noarch 12/18
Verifying : php-mcrypt-5.4.13-1.el6.remi.i686 13/18
Verifying : libxcb-1.8.1-1.el6.i686 14/18
Verifying : php-fpm-5.4.13-1.el6.remi.i686 15/18
Verifying : libXpm-3.5.10-2.el6.i686 16/18
Verifying : php-common-5.4.13-1.el6.remi.i686 17/18
Verifying : mysql-libs-5.5.30-1.el6.remi.i686 18/18
Installed:
php-cli.i686 0:5.4.13-1.el6.remi php-common.i686 0:5.4.13-1.el6.remi
php-fpm.i686 0:5.4.13-1.el6.remi php-gd.i686 0:5.4.13-1.el6.remi
php-mbstring.i686 0:5.4.13-1.el6.remi php-mcrypt.i686 0:5.4.13-1.el6.remi
php-mysql.i686 0:5.4.13-1.el6.remi php-pdo.i686 0:5.4.13-1.el6.remi
php-pear.noarch 1:1.9.4-12.el6.remi.1 php-xml.i686 0:5.4.13-1.el6.remi
Dependency Installed:
libX11.i686 0:1.5.0-4.el6 libX11-common.noarch 0:1.5.0-4.el6
libXau.i686 0:1.0.6-4.el6 libXpm.i686 0:3.5.10-2.el6
libmcrypt.i386 0:2.5.7-5.el5 libxcb.i686 0:1.8.1-1.el6
mysql-libs.i686 0:5.5.30-1.el6.remi t1lib.i686 0:5.1.2-6.el6_2.1
Complete!
[root@galihreza ~]# rpm -qa | grep -i php
php-common-5.4.13-1.el6.remi.i686
php-cli-5.4.13-1.el6.remi.i686
php-gd-5.4.13-1.el6.remi.i686
php-pear-1.9.4-12.el6.remi.1.noarch
php-xml-5.4.13-1.el6.remi.i686
php-pdo-5.4.13-1.el6.remi.i686
php-mcrypt-5.4.13-1.el6.remi.i686
php-mysql-5.4.13-1.el6.remi.i686
php-mbstring-5.4.13-1.el6.remi.i686
php-fpm-5.4.13-1.el6.remi.i686
[root@galihreza ~]# service php-fpm start
Starting php-fpm: [ OK ]
[root@galihreza ~]#
keterangan :
rpm -qa | grep -i php adalah perintah untuk megecek apa yang sudah kita install.
service php-fpm start adalah untuk mengetes dan menjalankan :D
3. Konfigurasikan PHP-FPM agar sinkron dengan server Nginx
edit file www.conf di folder /etc/php-fpm.d/
atau bisa juga menggunakan comand nano
nano /etc/php-fpm.d/www.conf
contoh confignya
listen = 127.0.0.1:9000
listen.owner = nginx
listen.group = nginx
listen.mode = 0666
user = nginx
group = nginx
pm = dynamic
pm.max_children = 16
pm.start_servers = 4
pm.min_spare_servers = 4
pm.max_spare_servers = 8
pm.max_requests = 512









saya disana menggunakan sftp dan php designer agar lebih mudah
ini config yang sudah saya edit
http://galihrezah.mywapblog.com/files/wwwvps.zip
kalau udah kita test
service php-fpm restart
kalau tampil

Starting php-fpm: [20-Mar-2013 07:24:44] ERROR: [pool www] cannot get uid for us
er 'nginx'
[20-Mar-2013 07:24:44] ERROR: FPM initialization failed
[FAILED]
kalau tampil seperti itu
kita edit usernya menjadi apache

user = apache
group = apache
ne filenya
http://galihrezah.mywapblog.com/files/wwwvps2.zip
ketikan lagi
service php-fpm restart
dan hasilnya

4. Test Konfigurasi Agar Bisa Membaca File dan Script PHP
Kalau PHP-FPM sudah bisa berjalan, sekarang saatnya untuk mengombinasikan antara Nginx dan PHP-FPM sehingga request yang ditujukan untuk web server bisa mengeksekusi file PHP. Untuk keperluan ini kita menggunakan file khusus untuk konfigurasi domain yang akan ditempatkan di folder /etc/nginx/conf.d/
Untuk keperluan ini saya menggunakan contoh subdomain galihreza.biz, maka konfigurasi dari file konfigurasi bisa kita beri nama galihreza.conf dengan full path /etc/nginx/conf.d/galihreza.conf dengan isi file sebagai berikut.
server {
## Nama website anda
server_name galihreza.biz www.galihreza.biz;
## PATH dari root directory website
root /home/siskusi/galihreza.biz;
listen 80;
## File yang akan dibaca sebagai indeks dari file konfigurasi (Diload oleh Nginx)
index index.html index.php;
## Jangan perbolehkan akses ke file hidden
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# Baca file PHP
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}



5. Konfigurasi tambahan
edit file /etc/php.ini dan rubah beberapa bagian menjadi seperti ini.
short_open_tag = On
memory_limit = 128M
cgi.fix_pathinfo = 0
upload_max_filesize = 2M
Bagi yang belum terbiasa setting seperti ini mungkin akan membingungkan. Tetapi jika anda membiasakan diri dan terus belajar, lama kelamaan akan terbiasa dan tidak akan bingung lagi.
gampang yah? eheeheh
source : http://wiki.centos.org/AdditionalResources/Repositories
semoga bermanfaat Maju terus indonesia dan tetap berhati-hati dalam hidup ini,semoga bermanfaat dan sukses semoga ALLAH slalu memberikan yang terbaik selamanya kepada galihrezah dan kekasihnya,,,amin hehehe makasih blog galihrezah.blogspot.com BEBAS DI COPY PASTE posting ini di buat untuk memberikan pengetahuan kepada yang belum mengetahuinya,jadi tidak ada larangan untuk tidak mengcopy di blog ini,trimakasih untuk yang udah mau mengcopy di blog ini,sebarkan ilmu semampu anda dengan ikhlas kawan, semoga ALLAH membalas kebaikan anda.amin
bentar ane mikir dulu buat postingan besok,,hehe
hehehe jadi malu
kabur ah..hahaha
waduh kurang cepet ne
balik lagi ah hehehe..
eh ga jadi kabur hihihi
maaf-maaf kalau ane ada salah..hehe
minum dulu gan
salam kenal yah hehehe
thanks for visiting this blog and CMIIW (Correct Me If I am Wrong) laporkan kesini http://facebook.com/mamawmastercrackerbila link unduh broken,untuk daftar isi disini rss galihrezah.blogspot.com - hohoho selamat mengcopy ya sob 





Posting Komentar