yum install php56w-fpm php56w-mysql php56w-gd php56w-gd php56w-dom php56w-mbstring
nano /etc/php-fpm.d/www.conf
(...)
listen = /var/run/php-fpm/php-fpm.sock
listen.owner = nginx
listen.group = nginx
user = nginx
group = nginx
php_value[upload_max_filesize] = 128M
php_value[post_max_size] = 128M
php_value[max_execution_time] = 200
php_value[date.timezone] = 'UTC'
(...)

chown -R nginx:nginx /usr/share/nginx/html
chown nginx:nginx /var/run/php-fpm/php-fpm.sock

nano /etc/php.ini
(...)
; Dangerous when = 1
cgi.fix_pathinfo=0
(...)


mkdir -p /var/lib/php/session
chown nginx:nginx /var/lib/php/session

VHOST=www.yoursite.com
nano /etc/nginx/sites-available/$VHOST.conf
(...)
ln -s /etc/nginx/sites-available/$VHOST.conf /etc/nginx/sites-enabled/$VHOST.conf

systemctl enable php-fpm
systemctl reload nginx
systemctl restart php-fpm

 

See also: https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7

Advertisements