Author Topic: centos 7.x nginx php-fastcgi php-7 download script php howto fixed  (Read 1846 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
centos 7.x nginx php-fastcgi php-7 download script php howto fixed
« on: กรกฎาคม 31, 2020, 11:00:32 PM »
ทำการเพิ่ม
   location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

ลงไปในแถบ server ใน nginx.conf ดังข้างล่างครับ

vi /etc/nginx/nginx.conf

server {
    server_name www.packetlove.com packetlove.com; # managed by Certbot
        index index.php index.html index.htm;
        root         /var/www/it-money.com/public_html;
        include snippets/phpMyAdmin.conf;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        if ( !-e $request_filename ){
                rewrite ^/(.*)$ /index.php?/$1 last;
                break;
        }

        location / {
                try_files $uri $uri/ /index.html;
        }

         location ~ .php$ {
                try_files $uri =404;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
....

หลังจากนั้นทำการ restart nginx 1 รอบ