I have create post about installing nginx + php-fpm from source before in herehttp://adityo.blog.binusian.org/?p=428. In this tutorial i will create a more simple way installing nginx + php-fpm using yum with centos.alt.ru & EPEL repo.
Here it’s goes:
- Create repo
# cd /etc/yum.repos.d
# vim rusia-repo.repo
- and paste this
[rusia-repo]
name=CentOS-$releasever – rusia packages for $basearch
#baseurl=file:///raid/RH/CentOS/$releasever/local/$basearch
baseurl=http://centos.alt.ru/pub/repository/centos/5/i386/
enabled=1
gpgcheck=0
protect=1
- Enable EPEL repo
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/$(uname -m)/epel-release-5-3.noarch.rpm
- Install nginx and php-fpm
# yum install nginx php-fpm
- go to nginx configuration file: “/usr/local/nginx/conf/nginx.conf” , and add the php configuration
location ~ \.php$ {
root /usr/share/nginx/html; # itmena the root of the coument are located on
/usr/share/nginx/html
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name;
include fastcgi_params;
}
- Go to /usr/share/nginx/html and create php files
# vi index.php
<?php phpinfo(); ?>
- Start the nginx and php-fpm
# service php-fpm start
# service nginx start
You can go to your server domain / ip address to see the phpinfo files
Source : Here