The company has equipped a new computer, the M1 MacBook Air. Although the screen is small, its performance is currently good, so a new environment must be installed.
Both nginx and PHP environments are installed, and then an error is reported as soon as they run File not found
. After reading the nginx error log, various searches can't find a solution. One is the file permission problem, and the other is php- The permission problem of fpm, and it may be the problem of nginx.
I thought about it. When I used MacBook Pro a few years ago, I also used the brew
installation environment, and there was no big problem. If I want to go, I also directly print the configuration fastcgi_param SCRIPT_FILENAME
in the nginx configuration file, but no problem is found, as expected. Things can't go on here.
Then I thought about it, this permission problem, then I also configured the permissions, I looked at the user group at runtime, it is estimated that it is different from my current user group, and then I looked at my fastcgi_param SCRIPT_FILENAME
file Point to configuration. I used ~/projects
to save trouble. Then I wondered if it was detected at runtime ~/
this value is wrong, which itself represents /Users/张三
in my current environment, and will it become /Users/李四
? Biting the bullet, I tried it, and it was done. The matter was solved so simply, and my mentality collapsed.
In the end, it is enough to replace it with an absolute path. It can be regarded as a long lesson. Some things that are used to be placed in the configuration file may be a big pit.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。