Initial Setup: Failed to start PHP 7.0 FastCGI

2,090 views
Skip to first unread message

Jonathan Sinclair

unread,
Sep 15, 2017, 2:27:57 PM9/15/17
to ica-ato...@googlegroups.com
*Linux newbie disclaimer*
I have followed for installing on Ubuntu 16.04 LTS and have run into some trouble.
AtoM 2.4
Percona Server 5.6
Java 8
Elasticsearch
Nginx
PHP 7.0
Gearman Job Server
All configured as per the setup guide

Everything went well until I tried I tried to run the web installer and got not response. Checking, I saw nginx was running, but did not have a socket open on port 80, (or any other port that I could see). The PHP test is successful
I reviewed the configuration files and only found 1 typo which I corrected. However, PHP is not starting with error:
"ERROR: [pool atom] cannot get gid"
"ERROR: FPM initialization failed"
"php7.0-fpm.service: Main process exited, code=exited, status=78" 
"Failed to start The PHP 7.0 FastCGI Process Manager"

sbr...@artefactual.com

unread,
Sep 15, 2017, 3:37:48 PM9/15/17
to AtoM Users
Hi Johnathan

The first error "ERROR: [pool atom] cannot get gid" implies that in /etc/php/7.0/fpm/pool.d/atom.conf that the 'group' value cannot be found on your Ubuntu system.  In the AtoM installation instructions, this is set to 'www-data'.

This is the group setting for the user that will be running php-fpm when the system is responding to web request calls.  By default NGINX is set to use 'www-data' for both 'user' and 'group'.

What value to you have specified for group and user in that file?  Then next step would be to determine if that user and group are set up on your system.


Steve

Jonathan Sinclair

unread,
Sep 15, 2017, 4:19:26 PM9/15/17
to AtoM Users
Thanks, that makes sense as I configured www-data for both the user and group, but did not create the user/groups in Ubuntu.
If I have time this weekend, I'll give that a try, otherwise on Monday.

sbr...@artefactual.com

unread,
Sep 15, 2017, 5:17:34 PM9/15/17
to AtoM Users
I believe the installation of nginx should have created both the user and the group.  Let me know what you find in the file /etc/group.  'www-data' should be listed in there.

You can check by running the command:

cat /etc/group | grep www-data

If www-data is contained in that file, it will output the www-data line to the screen.  If it is not found inside, it won't output anything.

Let me know what you find.

Jonathan Sinclair

unread,
Sep 16, 2017, 10:54:26 AM9/16/17
to AtoM Users
I do see the www-data group
Output: www-data:x:33:

sbr...@artefactual.com

unread,
Sep 18, 2017, 4:04:04 PM9/18/17
to AtoM Users
Hi Jonathan

Ok - that sounds then like the www-data group was set up correctly during install. 

Let's double check what user and group php-fpm is attempting to start as. This is set in '/etc/php/7.0/fpm/pool.d/atom.conf'.

Run the following on your server:

> cat /etc/php/7.0/fpm/pool.d/atom.conf | grep user
> cat /etc/php/7.0/fpm/pool.d/atom.conf | grep group

The above commands should return what the user and group lines are set to.  These should both be 'www-data'. 


Steve

Jonathan Sinclair

unread,
Sep 19, 2017, 9:48:11 AM9/19/17
to AtoM Users
Hi Steve,
Thanks, I found the error in atom.conf corrected the group line to "www-data". PHP is now starting.
I gave the server a reboot for good measure but unfortunately still don't see port 80 open, and cannot connect over HTTP. I re-ran: 'sudo systemctl enable nginx' & 'sudo systemctl reload nginx'

sbr...@artefactual.com

unread,
Sep 19, 2017, 10:55:21 AM9/19/17
to AtoM Users
That's good news Johnathan!  

Regarding port 80 - I am wondering if you are running a firewall.  First let's verify that nginx is listenting on port 80:

> sudo netstat -tanpl | grep nginx 


Secondly, you can check if UFW (firewall) is running on your server, and what ports are open by running this command:

> sudo ufw status verbose


Let me know what the results of this are.


Steve

Jonathan Sinclair

unread,
Sep 19, 2017, 2:05:53 PM9/19/17
to ica-ato...@googlegroups.com
Ok, so there is no output from netstat
And UFW status is inactive

Friesen, Darryl

unread,
Sep 19, 2017, 2:17:29 PM9/19/17
to ica-ato...@googlegroups.com

I don’t want to hijack Steve’s helpful thread here (but I will), but not getting output from netstat seems to indicate nginx is not running.  You can double check by running either (or both!) of these:

 

     systemctl status nginx

 

     ps -ef | grep nginx

 

 

- Darryl

----------------------------------------------------------------------
Darryl Friesen, B.Sc., Programmer/Analyst    Darryl....@usask.ca
Library Systems & Information Technology,    
http://library.usask.ca/
University of Saskatchewan Library
----------------------------------------------------------------------
"Go not to the Elves for counsel, for they will say both no and yes"

 

 

 

From: ica-ato...@googlegroups.com [mailto:ica-ato...@googlegroups.com] On Behalf Of Jonathan Sinclair
Sent: Tuesday, September 19, 2017 12:06 PM
To: AtoM Users <ica-ato...@googlegroups.com>
Subject: [ica-atom-users] Re: Initial Setup: Failed to start PHP 7.0 FastCGI

 

Ok, so there is not output from netstat

--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at https://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/07138b9e-e2a4-489b-8475-31f3766e866a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sbr...@artefactual.com

unread,
Sep 19, 2017, 3:43:20 PM9/19/17
to AtoM Users
Thanks Darryl - exactly where I was going next!!

Let us know what the results are Jonathan.


To post to this group, send email to ica-at...@googlegroups.com.

Jonathan Sinclair

unread,
Sep 19, 2017, 5:05:21 PM9/19/17
to AtoM Users
Ok results as follows:
systemctl status nginx:
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: active (running) since <today>
Process: 2316 ExecReload=/usr/sbin/nginx -g daemon on; master_process on; -s reload (code=exited,
Main PID: 1221 (nginx)
Tasks: 3
Memory: 9.4M
CPU 1.147s
CGroup: /system.slice/nginx.service
1221 nginx: master process /usr/sbin/nginx -g daemon on; master_process on
2320 nginx: worker process
2321 nginx: worker process

ps -ef | grep nginx:
root 1221 1 0 09:16 ? 00:00:00:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 2320 1221 0 09:35 ? 00:00:01 nginx: worker process
www-data 2321 1221 0 09:35 ? 00:00:00 nginx: worker process

Friesen, Darryl

unread,
Sep 19, 2017, 5:49:09 PM9/19/17
to ica-ato...@googlegroups.com

It’s weird that systemctl show nginx as running, but netstat does not.  I’ll leave it for Steve to offer you good advice.  My only suggestion is to double check netstat again, and possibly look for port 80 (in case something else is using that).

 

    sudo netstat -peanut | grep nginx

    sudo netstat -peanut | grep ":80"

 

-          Darryl

To post to this group, send email to ica-ato...@googlegroups.com.

sbr...@artefactual.com

unread,
Sep 19, 2017, 10:58:33 PM9/19/17
to ica-ato...@googlegroups.com
That is odd.  I wonder if something else is installed on your server and is listening on port 80?

Darryl had a great suggestion - run the netstat command but search for port 80:

    sudo netstat -peanut | grep ":80"

This will tell us if something else perhaps is listening on that port.


If that does not identify the issue, I would say the next step would be to check your nginx config file.  If you followed our AtoM installation instructions, you should find it here:

/etc/nginx/sites-available/atom

...and it must have a symlink to this file in the following directory (you should see a file called 'atom' in '/etc/nginx/sites-enabled' and it should be identical):

/etc/nginx/sites-enabled/atom

The instructions where you initially created this symlink are here in the AtoM install instructions (look for 'ln -s'):
https://www.accesstomemory.org/en/docs/2.4/admin-manual/installation/linux/ubuntu-xenial/#nginx

This file contains the port number that nginx should listen on, and the root folder for your atom install files. Perhaps something is misconfigured in here, or perhaps the file in '/etc/nginx/sites-enabled' was not created.


Steve

Jonathan Sinclair

unread,
Sep 20, 2017, 9:37:27 AM9/20/17
to AtoM Users
Success!
The symlink was not in place and sites-enabled was empty. Nginx is running, port 80 is listening, and I can access the web page.

Thanks for the help, great support!


On Tuesday, September 19, 2017 at 10:58:33 PM UTC-4, sbr...@artefactual.com wrote:
That is odd.  I wonder if something else is installed on your server and is listening on port 80?

Darryl had a great suggestion - run the netstat command but search for port 80:

    sudo netstat -peanut | grep ":80"

This will tell us if something else perhaps is listening on that port.


If that does identify the issue, I would say the next step would be to check your nginx config file.  If you followed our AtoM installation instructions, you should find it here:

Jonathan Sinclair

unread,
Sep 20, 2017, 10:23:18 AM9/20/17
to AtoM Users
Spoke a little too soon. Running through the web installer, I'm getting stuck at the ElasticSearch config: "Can't connect to the server (Failed to connect to localhost port 9200: Connection refused)."
I ran "sudo systemctl start elasticsearch". And the process appears for a few seconds before disappearing. Port 9200 does not show as listening.

sbr...@artefactual.com

unread,
Sep 20, 2017, 10:52:08 AM9/20/17
to AtoM Users
Sounds like Elasticsearch is not starting properly or is malfunctioning.  I can't determine much more without additional information / error messages etc. 


...perhaps a step was missed?  Elasticsearch requires openjdk 8 to be installed - this is covered in that section.

With any systemctl call, you can display 'status' which will let you know if the process is running or not, and give you hints as to what could be wrong if it's not starting:

sudo systemctl status <any_service_name>
sudo systemctl status elasticsearch

Steve

Jonathan Sinclair

unread,
Sep 20, 2017, 12:42:57 PM9/20/17
to AtoM Users
Looks good now, Java 9 was installed.
Everything is running and web setup is done.

Thanks again for all the help.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages