Penyelesaian kepada kegagalan permulaan php7-fpm Linux: 1. Ubah suai item "error_log" dalam fail "php-fpm.conf" 2. Ubah suai lokasi fail konfigurasi php; , ubah suai nginx kepada nama pengguna sistem semasa 4. Buat pengguna dan kumpulan pengguna nginx secara langsung.
Penyelesaian kepada kegagalan permulaan php-fpm (selepas memasang PHP pada centOS)
Selepas menyusun dan memasang php7.2.1 pada centOS7.0, kerana yang baharu php, jadi anda perlu memulakan semula php-fpm; tersedia. Anda perlu membuat cp satu demi satu dan kemudian memulakannya Jika tiada ralat, anda tidak perlu membaca "2. php-fpm startup error:"
1. fpm
cp php.ini-development /usr/local/php7/etc/php.ini cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
2. 🎜>
Mulakan php-fpm:/usr/local/php/sbin/php-fpm
$ php-fpm [11-Jan-2014 16:03:03] ERROR: failed to open configuration file '/private/etc/php-fpm.conf': No such file or directory (2) [11-Jan-2014 16:03:03] ERROR: failed to load configuration file '/private/etc/php-fpm.conf' [11-Jan-2014 16:03:03] ERROR: FPM initialization failed
# cp /private/etc/php-fpm.conf.default /etc/php-fpm.conf $ php-fpm --fpm-config /etc/php-fpm.conf [11-Jan-2014 16:10:49] ERROR: failed to open error_log (/usr/var/log/php-fpm.log): No such file or directory (2) [11-Jan-2014 16:10:49] ERROR: failed to post process the configuration [11-Jan-2014 16:10:49] ERROR: FPM initialization failed
$ vim /usr/local/etc/php-fpm.conf
error_log = /usr/local/var/log/php-fpm.log pid = /usr/local/var/run/php-fpm.pid
$ php-fpm --fpm-config /php-fpm.conf --prefix /usr/local/var
[12-Jul-2013 17:18:57] ERROR: [/usr/local/php5/etc/php-fpm.conf:144] value is NULL for a ZEND_INI_PARSER_ENTRY [12-Jul-2013 17:18:57] ERROR: failed to load configuration file '/usr/local/php5/etc/php-fpm.conf' [12-Jul-2013 17:18:57] ERROR: FPM initialization failed
[root@localhost ~]# /usr/local/php5/sbin/php-fpm PHP: syntax error, unexpected TC_STRING in /usr/local/php5/etc/php.ini on line 211
/usr/local/php/sbin/php-fpm
<code><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">[07-Dec-2018 17:59:31] ERROR: [pool www] cannot get uid for user &#39;nginx&#39;
[07-Dec-2018 17:59:31] ERROR: FPM initialization failed</pre><div class="contentsignin">Salin selepas log masuk</div></div>
Ubah suai lokasi fail konfigurasi php di www .conf vi /usr/local/php/etc/php-fpm.d/www.conf
; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. user = www.emam.cn group = www.emam.cn
useradd nginx groupadd nginx usermod -G nginx nginx
<code><div class="code" style="position:relative; padding:0px; margin:0px;"><div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">/usr/local/php/sbin/php-fpm</pre><div class="contentsignin">Salin selepas log masuk</div></div><div class="contentsignin">Salin selepas log masuk</div></div>
Proses induk boleh memahami isyarat berikut
# ps aux|grep php-fpm root 21891 0.0 0.0 112660 960 pts/3 R+ 16:18 0:00 grep --color=auto php-fpm root 42891 0.0 0.1 182796 1220 ? Ss 4月18 0:19 php-fpm: master process (/usr/local/php/etc/php-fpm.conf) nobody 42892 0.0 0.6 183000 6516 ? S 4月18 0:07 php-fpm: pool www nobody 42893 0.0 0.6 183000 6508 ? S 4月18 0:17 php-fpm: pool www
kill -USR2 42891
[global] ; Pid file ; Note: the default prefix is /usr/local/php/var ; Default Value: none ;pid = run/php-fpm.pid
kill -INT 'cat /usr/local/php/var/run/php-fpm.pid'
rreeee
Atas ialah kandungan terperinci Bagaimana untuk menyelesaikan kegagalan permulaan linux php7-fpm. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!