mac nginx php php-fpm
#the php-fpm config and cammand...
cp /private/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
php-fpm --fpm-config /usr/local/etc/php-fpm.conf --prefix /usr/local/var
ps aux | grep 'php-fpm'
killall -HUP php-fpm
#the nginx config and cammand...
brew services restart nginx
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
=====>
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
可以在你的location php 里面添加当文件不存在时返回404而不是交给php-fpm进行处理
location ~ \.php$
{
...
#文件不存在转404
try_files $uri = 404;
...
}
然后,在你的配置文件中找到下面这段
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
mac 启动php-fpm
Nginx访问PHP文件的File not found错误处理,两种情况
这个错误很常见,原有有下面两种几种
1. php-fpm找不到SCRIPT_FILENAME里执行的php文件
2. php-fpm不能访问所执行的php,也就是权限问题
第一种情况
可以在你的location php 里面添加当文件不存在时返回404而不是交给php-fpm进行处理
location ~ \.php$
{
...
#文件不存在转404
try_files $uri = 404;
...
}
然后,在你的配置文件中找到下面这段
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
然后重新加载nginx配置文件
第二种情况
两种解决方法:
第一种,就是把你root文件夹设为其他用户允许
第二种,找到你的php-fpm的配置文件,找到下面这段,把apache替换成你要的用户组
; RPM: apache Choosed to be able to access some dir as httpd
user = apache
; RPM: Keep a group allowed to write in log dir.
group = apache
mac 启动php-fpm
mac nginx php php-fpm的更多相关文章
- Mac + nginx + lua + luasocket + cjson
1. Lua // 官方网站 http://www.lua.org/ 下载源码包// 由于配合 nginx 使用, 所以使用 5.1.X 版本 $ .tar.gz $ cd lua- $ make m ...
- mac nginx 一些资料
http://www.jianshu.com/p/918eb337a206 mac 的nginx 配置目录在/usr/local/etc/nginx 安装之前最好执行brew的update和upgra ...
- mac nginx php-fpm
再一次被困在一个傻问题.由于我居然怀疑是不是mac本身就和centos的安装不一样.在一次次地排错后,最终发现.原来是我的nginx.conf的一行配置少写了一个字母.最后多亏用ls检查来定位到这个错 ...
- MAC NGINX PHP XDEBUG
1. 安装 homebrew 2. 安装nginx ; 终端运行 brew install nginx: 1)给nginx 设置管理员权限:如果不设置管理员权限,80端口是不能监听的: #这里的目录根 ...
- mac nginx 启动 自启动
MacBook-Pro:local shihw$ brew services start nginx ==> Tapping homebrew/services Cloning into '/u ...
- mac nginx compile
编译 ./configure \ --prefix=/usr/local/services/nginx-1.14.0 \ --with-openssl=/Users/gavin/Downloads/s ...
- mac Nginx+CI出现404错误
主要是ci框架需要配置rewrite nginx.conf配置文件添加: location /wechat/ { if (!-e $request_filename) { rewrite ^/wech ...
- mac nginx+php-fpm配置(安装过后nginx后访问php文件下载,访问php文件请求200显示空白页面)
访问php文件下载是因为没配置php-fpm 两个问题主要都是nginx.conf配置的问题: /usr/local/etc/nginx/nginx.conf server { listen 8 ...
- mac nginx 安装教程
eeking a satisfactory solution to create a local web server for programming in macOS with PHP and My ...
随机推荐
- NX二次开发-获取面的法向向量UF_MODL_ask_face_data
NX9+VS2012 #include <uf.h> #include <uf_modl.h> #include <uf_obj.h> #include <u ...
- NX二次开发-UFUN替换组件UF_ASSEM_substitute_component
NX9+VS2012 #include <uf.h> #include <uf_ui.h> #include <uf_assem.h> #include <u ...
- error C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead.【转载】
文章出处https://blog.csdn.net/qq_38721302/article/details/82850292 今天编写C++程序在使用头文件#include<cstring> ...
- js Date.parse() format.
date format android chrome linux chrome Mobile safari ios chrome windows safari linux firefox window ...
- Area--->AreaRegistrationContext.MapRoute
文章引导 MVC路由解析---IgnoreRoute MVC路由解析---MapRoute MVC路由解析---UrlRoutingModule Area的使用 Area--->AreaRegi ...
- STM32F103
memory map • Four masters: – Cortex® -M3 core DCode bus (D-bus) and System bus (S-bus)– GP-DMA1 & ...
- POJ--Lost Cows (线段树)
题目:http://poj.org/problem?id=2182 http://acm.hdu.edu.cn/showproblem.php?pid=2711 题意:有N头牛,编号为1-- ...
- docker使用gitlab持续集成(1)
修改ssh连接端口vi /etc/ssh/sshd_config 写docker-compose.yml文件配置gitlab version: '3' services: gitlab: image: ...
- RabbitMQ学习第二记:工作队列的两种分发方式,轮询分发(Round-robin)和 公平分发(Fair dispatch)
1.什么是RabbitMQ工作队列 我们在应用程序使用消息系统时,一般情况下生产者往队列里插入数据时速度是比较快的,但是消费者消费数据往往涉及到一些业务逻辑处理导致速度跟不上生产者生产数据.因此如果一 ...
- c_ 数据结构_图_邻接矩阵
程序主要实现了图的深度遍历和广度遍历. #include <stdio.h> #include <stdlib.h> #include <string.h> #de ...