Nginx - Downloading PHP instead of executing

前端 未结 1 920
梦如初夏
梦如初夏 2021-01-24 00:42

I am using CentOS and I have two web pages which im using for a piece of work. The first is a .html which has a form which uses a .php script to send data to my mySQL database,

1条回答
  •  隐瞒了意图╮
    2021-01-24 01:01

    You must uncomment this part:

    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   unix:/var/run/php5-fpm.sock;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}
    

    Edit the file /var/run/php5-fpm.sock and change listen = 127.0.0.1:9000 to listen = /var/run/php5-fpm.sock.

    And to allow the server to only process the exact file path edit /etc/php5/fpm/php.ini and make sure cgi.fix_pathinfo=0.

    0 讨论(0)
提交回复
热议问题