1

I'm trying to run a PHP application in my intranet using Apache on OS X 10.10. I can successfully launch Apache using:

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist

The PHP app works correctly and can be accessed from other machines. However, apache is being shit down after a few minutes with no helpful error messages in the /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

My org.apache.httpd.plist is as follws:

<?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>

There is no php_error log in /var/log/apache2 .

Related to this problem might be this issue I have where Apache is shutdown after 2 seconds on reboot: https://stackoverflow.com/questions/34571520/apache-wont-start-on-boot-on-os-x-10-10

fnllc
  • 131
  • 3

0 Answers0