Bước 1: cài đặt
Để cài đặt ta run lệnh:
yum --enablerepo=epel -y install php php-mbstring php-pear php-fpm
Bước 2: cấu hình
Mở file /etc/php-fpm.d/www.conf
- Tìm: user = sửa thành: user = nginx
- Tìm: group = sửa thành group = nginx
Sau đó lần lượt run các lệnh
/etc/rc.d/init.d/php-fpm start
chkconfig php-fpm on
- Mở file vhost và thêm vào
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
- Khởi động lại nginx
service ninx restart
Done.
Đăng nhận xét Blogger Facebook
Click to see the code!
To insert emoticon you must added at least one space before the code.