yum install php-fpm php-mysql
nano /etc/php-fpm.d/www.conf
(...)
listen = /var/run/php-fpm/php-fpm.sock
listen.owner = nobody
listen.group = nobody
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

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


mkdir -p /var/lib/php_session_save
chown nginx:nginx /var/lib/php_session_save

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