【发布时间】:2019-01-23 03:09:47
【问题描述】:
我正在尝试在 Windows 7 64Bit 上配置 Nginx,PHP,以便 PHP 和 Nginx 都应该始终使用我在启动期间或在配置文件中指定的路径。
现在对于 Nginx,我正在使用以下 VBScript 启动它的服务器可执行文件,用于加载自定义配置文件:
... Vbs code ...
sh.run "cmd /K CD "& NginxPath &" & start nginx", 0
sh.run "cmd /K CD "& NginxPath &" & start nginx -c "& NginxConf, 0
sh.run "cmd /K CD "& NginxPath &" & start nginx -s reload", 0
... Vbs code ...
但它总是抛出相同的错误:
2019/01/21 06:53:52 [emerg] 6988#5196: CreateFile() "Custom\Path\mime.types" failed (2: The system cannot find the file specified) in Custom\Path\nginx.conf:18
即使出现此错误,服务器也会启动但会加载默认配置文件,这根本不应该发生。
顺便说一句,变量 NginxPath 和 NginxConf 都有正确的 Windows 路径和正确的双引号(例如“C:\path\file.conf”)
即使我们忘记了 VBscript,只是在 CMD 中触发以下命令,它也会给出相同的错误:
nginx -c C:\custom\path\nginx.conf
错误
nginx: [emerg] CreateFile() "C:\custom\path\mime.types" failed (2: The system cannot find the file specified) in C:\custom\path\nginx.conf:18
那么为什么会发生这种情况以及如何使用我想要的自定义 conf 文件来解决它?
【问题讨论】:
-
这个问题属于SuperUser,因为它是关于程序配置问题,而不是关于编程问题。
标签: nginx cmd vbscript config nginx-config