I'm trying to get PHP installed on my Linux device which already has Monkey Server installed, I do not have Apache installed. I want to be able to use FastCGI. I've downloaded and installed PHP7 according to these and these instructions and made sure the files are setup correctly; for the second link I did not install all of the packages listed at the beginning but most are already installed. The problem I am having is when I execute /etc/init.d/php-fpm start
I get a list of errors which are generated from the script trying to run /sbin/php-fpm
, the errors are as follows:
The /sbin/php-fpm
file is as follows:
[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
Lastly, I am running on a Yocto build of Linux so I do not have the luxury of sudo apt-get install <package>
. The second hyperlink from above I couldn't complete the instructions involving the commands insserv
and systemctl
because those two commands are not present. Any help is appreciated, I just want FastCGI on a lightweight server for embedded Linux. If there are better options I am open to them but Apache is too big.
I believe now my issues may be because I do not have systemd
on my Linux distrubution which is why it is not handling items like [Unit]
. Could someone please comment on this? I'm not familiar with systemd
.
Default Yocto build does not use systemd as init. For a lightweight server, I did recommend the lighttpd server and it has FastCGI support. Using Yocto you should build php and lighttpd and then transfer the php-cgi and lighttpd-module-fastcgi ipk's generated to the module. php and lighttpd can be included in the image by having
IMAGE_INSTALL_append = " php lighttpd"
in your local.conf file. The links that you refer to in your post are useless for Yocto.