在Ubuntu 16上,我使用以下配置选项编译PHP:
./configure --enable-debug \
--enable-maintainer-zts \
--enable-pthreads \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-mbstring \
--enable-cgi \
--with-curl \
--enable-soap \
--enable-zip \
--with-mcrypt \
--with-kerberos \
--with-zlib \
--with-gettext \
--enable-posix \
--enable-sockets \
--enable-pcntl \
--with-pear \
--with-sqlite3 \
--enable-inline-optimization \
--disable-rpath \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-mbregex \
--enable-bcmath \
--with-pcre-regex \
--with-openssl \
--enable-ftp \
--with-imap \
--with-imap-ssl \
--with-mhash \
--with-xmlrpc \
--with-xsl \
--enable-opcache
编译成功!
然后我用
apt-get install lighttpd gamin
lighty-enable-mod fastcgi
lighty-enable-mod fastcgi-php
service lighttpd force-reload
重启后我输入
sudo service lighttpd status
显示错误。 在 Lighttpd&#39> 错误日志中,我有:
2016-06-23 03:14:55: (log.c.164) server started
2016-06-23 03:15:02: (server.c.1558) server stopped by UID = 0 PID = 1
2016-06-23 03:15:03: (log.c.164) server started
2016-06-23 03:15:03: (mod_fastcgi.c.1112) the fastcgi-backend /usr/bin/php-cgi failed to start:
2016-06-23 03:15:03: (mod_fastcgi.c.1116) child exited with status 2 /usr/bin/php-cgi
2016-06-23 03:15:03: (mod_fastcgi.c.1119) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2016-06-23 03:15:03: (mod_fastcgi.c.1406) [ERROR]: spawning fcgi failed.
2016-06-23 03:15:03: (server.c.1022) Configuration of plugins failed. Going down.
如何处理这个问题? 我以前用Ubuntu 12.x / 14.x做同样的事情,Lighttpd工作正常
答案 0 :(得分:0)
确保/ usr / bin / php-cgi存在(并且是您构建的版本,如果这是您想要的),然后执行' / usr / bin / php-cgi your-script尤其是圆形'手动,就像lighttpd将执行它一样。然后你应该看看你的脚本失败的原因。