编程语言
首页 > 编程语言> > OS X:通过在系统启动时启动自动启动PHP FCGI

OS X:通过在系统启动时启动自动启动PHP FCGI

作者:互联网

因此,我从MacPorts以及Nginx和mysql安装了PHP5 FCGI.在系统启动期间,最后两个加载良好.但是PHP没有.我创建了一个文件/opt/local/etc/LaunchDaemons/org.macports.php5/org.macports.php5-cgi.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>Label</key>
  <string>org.macports.php5-cgi</string>
  <key>ProgramArguments</key>
  <array>
    <string>/opt/local/bin/php-cgi</string>
    <string>-b127.0.0.1:9000</string>
    <string>-q</string>
  </array>
  <key>EnvironmentVariables</key>
  <dict>
    <key>PHP_FCGI_CHILDREN</key>
    <string>8</string>
    <key>PHP_FCGI_MAX_REQUESTS</key>
    <string>256</string>
  </dict>
  <key>Debug</key><false/>
  <key>Disabled</key><true/>
  <key>KeepAlive</key><true/>
</dict>
</plist>

但是它不会在加载时开始.
我需要执行sudo launchctl load -w / opt / …才能手动启动它.

解决方法:

launchd不会从/ opt / local / etc / LaunchDaemons中读取文件.将文件放在/ Library / LaunchDaemons中,然后删除Disabled键.

标签:launchd,php
来源: https://codeday.me/bug/20191202/2086851.html