PHP Fast Page Manager allows to execute PHP Code very fast. The best way to have a high performance site is to pair it with Nginx Web Server.
Prerequisites:
Install PHP7 with FPM in a Vagrant Centos 7
Step 1. Tell PHP-FPM that you will be using Nginx as Web Server. open with a text editor this file:
[vagrant@localhost ~]$ sudo nano /etc/php-fpm.d/www.conf
look for user and group and chage them from apache to nginx:
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache user chosen to provide access to the same directories as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
save the file.
Step 2. Edit the Nginx virtual host conf file that will point to the php project:
[vagrant@localhost ~]$ sudo nano /etc/nginx/conf.d/php_code.conf
make sure you have this:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
}
Save the file.
This code snippet is telling Nginx that all files with php extension must be passed to the Fast Page Manager Server listening in port 9000.
Step 3. Check your nginx configuration is correct:
[vagrant@localhost ~]$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[vagrant@localhost ~]$
If you don't get this response, something is wrong in your Nginx config file and you wont be able to serve web pages.
Step 4. Restart services:
[vagrant@localhost ~]$ sudo systemctl restart php-fpm
[vagrant@localhost ~]$ sudo systemctl restart nginx
[vagrant@localhost ~]$