美文网首页
An error occurred

An error occurred

作者: 笨手笨脚越 | 来源:发表于2017-07-13 00:54 被阅读150次

访问http://localhost

图片.png

访问http://localhost/hello.php:

图片.png

是不是说明是php-fpm解析php有问题??!!!

其实是nginx和php-fpm 的配置文件里的端口没有设置一致!

/usr/local/etc/nginx/nginx.conf:

        #proxy the php scripts to php-fpm  
        location ~ .*\.php?$ {
            try_files $uri = 404;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_intercept_errors on;
            fastcgi_split_path_info ^(.+\.php)(.*)$;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }

/private/etc/php-fpm.conf:

listen = 127.0.0.1:9000

参考:

Mac OSX 10.9搭建nginx+mysql+php-fpm环境

相关文章

网友评论

      本文标题:An error occurred

      本文链接:https://www.haomeiwen.com/subject/lduihxtx.html