Unable to configure php-fpm from php 7.4.5 source install

549 views
Skip to first unread message

edflecko

unread,
May 18, 2020, 5:49:57 PM5/18/20
to highload-php-en
I have installed PHP 7.4.5 froum source on a CentOS 7 server. I'm trying to configure the php-fpm component and I'm having no success.

I've found a website that has, what seems to be, some somewhat accurate steps (https://linuxadmin.io/php-fpm-php7-source/). I have adjusted my paths accordingly.

Here are the exact sequence of steps I've taken (see below). If someone could point out what I'm doing wrong, I'd appreciate it and/or if there IS a tutorial on the web, etc., that I could refer to, I'd appreciate that as well!

(As root)
yum install bzip2-devel libcurl-devel libxml2-devel oniguruma-devel re2c sqlite-devel.x86_64 systemd-devel -y
tar -zxvf php-7.4.5.tar.gz
cd php-src-php-7.4.5
./buildconf --force
./configure --enable-bcmath --enable-calendar --enable-exif --enable-fpm --enable-mbstring --enable-opcache --enable-pcntl --enable-soap --enable-sockets --disable-short-tags --with-bz2 --with-curl --with-fpm-group=nginx --with-fpm-user=nginx --with-fpm-systemd --with-pdo-mysql --with-mysqli --with-openssl --with-pcre-jit --with-xmlrpc --with-zlib
make
make test
make install
cp /src/php-src-php-7.4.5/php.ini-production /usr/local/lib/php.ini
cp /src/php-src-php-7.4.5/sapi/fpm/www.conf /usr/local/etc/php-fpm.d/www.conf (or maybe: cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf)
cp /src/php-src-php-7.4.5/sapi/fpm/php-fpm.conf /usr/local/etc/php-fpm.conf
cp /src/php-src-php-7.4.5/sapi/fpm/php-fpm.service /etc/systemd/system/php-fpm.service
vi /usr/local/etc/php-fpm.d/www.conf (un-comment listen.owner = nginx , listen.group = nginx , and listen.mode = 0660)
cd /usr/sbin
ln -s /usr/local/sbin/php–fpm /usr/sbin/php–fpm
ls -l | grep php
systemctl enable php-fpm.service
systemctl daemon-reload
systemctl start php-fpm.service
Job for php-fpm.service failed because the control process exited with error code. See "systemctl status php-fpm.service" and "journalctl -xe" for details.

[root@localhost sbin]# systemctl status php-fpm.service -l
php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/etc/systemd/system/php-fpm.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2020-05-18 14:31:01 PDT; 1min 35s ago
  Process: 3670 ExecStart=/usr/local/sbin/php-fpm --nodaemonize --fpm-config /usr/local/etc/php-fpm.conf (code=exited, status=78)
 Main PID: 3670 (code=exited, status=78)

May 18 14:31:01 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
May 18 14:31:01 localhost.localdomain php-fpm[3670]: [18-May-2020 14:31:01] ERROR: Unable to globalize '/usr/local/NONE/etc/php-fpm.d/*.conf' (ret=2) from /usr/local/etc/php-fpm.conf at line 143.
May 18 14:31:01 localhost.localdomain php-fpm[3670]: [18-May-2020 14:31:01] ERROR: failed to load configuration file '/usr/local/etc/php-fpm.conf'
May 18 14:31:01 localhost.localdomain php-fpm[3670]: [18-May-2020 14:31:01] ERROR: FPM initialization failed
May 18 14:31:01 localhost.localdomain systemd[1]: php-fpm.service: main process exited, code=exited, status=78/n/a
May 18 14:31:01 localhost.localdomain systemd[1]: Failed to start The PHP FastCGI Process Manager.
May 18 14:31:01 localhost.localdomain systemd[1]: Unit php-fpm.service entered failed state.
May 18 14:31:01 localhost.localdomain systemd[1]: php-fpm.service failed.


[root@localhost sbin]# journalctl -xe
May 18 14:30:50 localhost.localdomain systemd[1]: [/etc/systemd/system/php-fpm.service:54]
May 18 14:30:50 localhost.localdomain polkitd[770]: Unregistered Authentication Agent for 
May 18 14:31:01 localhost.localdomain polkitd[770]: Registered Authentication Agent for un
May 18 14:31:01 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager
-- Subject: Unit php-fpm.service has begun start-up
-- Defined-By: systemd
-- 
-- Unit php-fpm.service has begun starting up.
May 18 14:31:01 localhost.localdomain php-fpm[3670]: [18-May-2020 14:31:01] ERROR: Unable 
May 18 14:31:01 localhost.localdomain php-fpm[3670]: [18-May-2020 14:31:01] ERROR: failed 
May 18 14:31:01 localhost.localdomain php-fpm[3670]: [18-May-2020 14:31:01] ERROR: FPM ini
May 18 14:31:01 localhost.localdomain systemd[1]: php-fpm.service: main process exited, co
May 18 14:31:01 localhost.localdomain systemd[1]: Failed to start The PHP FastCGI Process 
-- Subject: Unit php-fpm.service has failed
-- Defined-By: systemd
-- 
-- Unit php-fpm.service has failed.
-- 
-- The result is failed.
May 18 14:31:01 localhost.localdomain systemd[1]: Unit php-fpm.service entered failed stat
May 18 14:31:01 localhost.localdomain systemd[1]: php-fpm.service failed.
May 18 14:31:01 localhost.localdomain polkitd[770]: Unregistered Authentication Agent for 



Suggestions?

Thank you!

Ed

Scott Wozny

unread,
May 19, 2020, 11:37:59 AM5/19/20
to highloa...@googlegroups.com
I'm not particularly experienced at troubleshooting source installation problems, but the overall sysadmin troubleshooter in me compels me to ask if you have tried installing from the package manager just to get to a properly running baseline system you can use to identify what "good" looks like while you try troubleshoot your difficulties doing a build from source?

Maybe somebody here will recognize your build problem and help you directly, but if I was in your spot and couldn't use the packaged version for some reason, I'd start with examining a finished article I know works to assist my troubleshoot. 

Good luck!

Scott

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/highload-php-en/6a8996cb-e089-4859-b4d2-bbd1ab38f9ae%40googlegroups.com.

edflecko

unread,
May 19, 2020, 1:38:57 PM5/19/20
to highload-php-en
Scott,
I have done something very similar to what you're suggesting. I have installed php-fpm from a package, and it works fine with my php install from source. 

Once it was installed, I very carefully noted the difference between the "source" install php-fpm.conf, php-fpm.service, php.ini, and www.conf files and their counterparts from the php-fpm package...that works just fine. I them applied all of those individual, exact changes to the appropriate files to see if my php-fpm source install would run?...unfortunately, php-fpm didn't work using that method either!

You're probably asking why I bother to try and get php-fpm to work, from a source php install, when it will work from an installed package? Only because 1.) I like the granularity of control when installing from source and 2.) I'd like to understand what it the minimum, basic configuration that's needed to configure and run php-fpm from source!

Having said that, I'm hoping someone can/will share the secrets with me.

:-)

Ed

Scott Wozny

unread,
May 19, 2020, 1:46:37 PM5/19/20
to highloa...@googlegroups.com
Sounds like what I would have done.  Next step would be to start the service on each side under a logging strace instance and look for where the traces diverge. It's been a successful strategy in the past for me to allow me to focus on where, exactly, the failure is occurring and at least identify the culprit, if not the cause. :)

--

---
You received this message because you are subscribed to the Google Groups "highload-php-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highload-php-...@googlegroups.com.

edflecko

unread,
May 19, 2020, 2:01:01 PM5/19/20
to highload-php-en
Thanks Scott!

On a side note, I'm very surprised that there are no tutorials online (at least none that I've seen) that demonstrate how to configure php-fpm from source!

Ed
Reply all
Reply to author
Forward
0 new messages