Nginx-mac Build PHP Environment error?

Source: Internet
Author: User

My nginx and php-fpm all have to start. But still error, Google still no fruit, omnipotent community, help Ah!
View information

The configuration file is as follows:

The error message is as follows:

Reply content:

My nginx and php-fpm all have to start. But still error, Google still no fruit, omnipotent community, help Ah!
View information

The configuration file is as follows:

The error message is as follows:

It is recommended that you set a domain name for each project directory

sudo vi /etc/hosts//添加127.0.0.1    demo.dev

Open/usr/local/etc/nginx/servers

Then create a new configuration file for example demo.conf content as follows:

server {    listen 80;    server_name demo.dev; #域名    root /Users/程序目录; #程序目录    index index.html index.php;        # 伪静态    #location / {    #    try_files $uri $uri/ /index.php$is_args$query_string;    #}    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, browser access Demo.dev is done

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

Give it a try.

server {    listen 80;    server_name localhost;    root /path; #注意这里配置为你的网站根目录    index index.html index.htm index.php;    location / {        #try_files $uri $uri/ /index.php$is_args$args;    }        location ~ \.php$ {        try_files $uri =404;        include fastcgi_params;        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        fastcgi_pass 127.0.0.1:9000;        fastcgi_index index.php;    }}

It is advisable to vagrant the LNMP environment on the Mac. Baidu has a lot of solutions

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.