【发布时间】:2016-11-07 23:22:29
【问题描述】:
我正在尝试在我已经安装了 Monkey Server 的 Linux 设备上安装 PHP,但我没有安装 Apache。我希望能够使用 FastCGI。我已经按照these 和these 的说明下载并安装了PHP7,并确保文件设置正确;对于第二个链接,我没有安装开头列出的所有软件包,但大多数已经安装。我遇到的问题是,当我执行 /etc/init.d/php-fpm start 时,我得到了一个错误列表,这些错误是由试图运行的脚本生成的
/sbin/php-fpm,报错如下:
- 启动 php-fpm
- /sbin/php-fpm: line 1: [Unit]: command not found
- /sbin/php-fpm:第 2 行:PHP:找不到命令
- /sbin/php-fpm:第 3 行:network.target:找不到命令
- /sbin/php-fpm: line 5: [Service]: command not found
- /sbin/php-fpm:第 8 行:--nodaemonize:找不到命令
- /sbin/php-fpm:第 9 行:-USR2:找不到命令
- /sbin/php-fpm:第 11 行:[安装]:
- 找不到命令.......................失败
/sbin/php-fpm文件如下:
[Unit]
Description=The PHP FastCGI Process Manager
After=syslog.target network.target
[Service]
Type=@php_fpm_systemd@
PIDFile=@localstatedir@/run/php-fpm.pid
ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
最后,我在 Linux 的 Yocto 版本上运行,所以我没有 sudo apt-get install <package> 的奢侈。上面的第二个超链接我无法完成涉及命令insserv 和systemctl 的说明,因为这两个命令不存在。
感谢任何帮助,我只希望在嵌入式 Linux 的轻量级服务器上使用 FastCGI。如果有更好的选择,我愿意接受,但 Apache 太大了。
编辑:
我相信现在我的问题可能是因为我的 Linux 发行版上没有 systemd,这就是它不处理像 [Unit] 这样的项目的原因。有人可以对此发表评论吗?我不熟悉systemd。
【问题讨论】:
标签: php linux embedded webserver fastcgi