我试图在OS X 10.10上使用Apache在Intranet上运行PHP应用程序。 我可以成功地启动Apache使用:
sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
PHP应用程序正常工作,可以从其他机器访问。 但是,在几分钟后,apache会在/ var / log / apache2 / error_log中没有有用的错误消息
[Sat Jan 02 22:21:38.685725 2016] [mpm_prefork:notice] [pid 112] AH00163: Apache/2.4.16 (Unix) PHP/5.5.29 configured -- resuming normal operation [Sat Jan 02 22:21:38.685807 2016] [mpm_prefork:info] [pid 112] AH00164: Server built: Jul 22 2015 21:03:09 [Sat Jan 02 22:21:38.685828 2016] [core:notice] [pid 112] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Sat Jan 02 22:21:38.685839 2016] [mpm_prefork:debug] [pid 112] prefork.c(992): AH00165: Accept mutex: flock (default: flock) [Sat Jan 02 22:21:40.000785 2016] [core:info] [pid 112] AH00096: removed PID file /private/var/run/httpd.pid (pid=112) [Sat Jan 02 22:21:40.000820 2016] [mpm_prefork:notice] [pid 112] AH00169: caught SIGTERM, shutting down [Sun Jan 03 07:49:55.202584 2016] [mpm_prefork:notice] [pid 6104] AH00163: Apache/2.4.16 (Unix) PHP/5.5.29 configured -- resuming normal operation [Sun Jan 03 07:49:55.202661 2016] [core:notice] [pid 6104] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Sun Jan 03 08:16:48.067316 2016] [mpm_prefork:notice] [pid 6104] AH00169: caught SIGTERM, shutting down [Sun Jan 03 08:59:41.027663 2016] [mpm_prefork:notice] [pid 50443] AH00163: Apache/2.4.16 (Unix) PHP/5.5.29 configured -- resuming normal operations [Sun Jan 03 08:59:41.027735 2016] [core:notice] [pid 50443] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Sun Jan 03 09:18:07.822248 2016] [mpm_prefork:notice] [pid 50443] AH00169: caught SIGTERM, shutting down
我的org.apache.httpd.plist如下所示:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Disabled</key> <false/> <key>EnvironmentVariables</key> <dict> <key>XPC_SERVICES_UNAVAILABLE</key> <string>1</string> <key>PATH</key> <string>/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string> </dict> <key>Label</key> <string>org.apache.httpd</string> <key>KeepAlive</key> <true/> <key>ProgramArguments</key> <array> <string>/usr/sbin/httpd-wrapper</string> <string>-D</string> <string>FOREGROUND</string> </array> </dict> </plist>
/ var / log / apache2中没有php_error日志。
与此问题相关的可能是这个问题我已经在2秒后重新启动Apache关机: https : //stackoverflow.com/questions/34571520/apache-wont-start-on-boot-on-os-x-10- 10