Unable to start php54-fpm

Bug #1237617 reported by Marek Zakrzewski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
IUS Community Project
Won't Fix
Undecided
Unassigned

Bug Description

/etc/init.d/php-fpm start
Starting php-fpm: [09-Oct-2013 19:47:55] ERROR: An another FPM instance seems to already listen on /home/php-fpm/sock/mareklipski.sock
[09-Oct-2013 19:47:55] ERROR: FPM initialization failed
                                                           [FAILED]

I have to do killall -9 php-fpm; pkill -o php-fpm; then restart with /etc/init.d/php-fpm restart

This happens every 10-30 minutes and all pages display Internal Server Error at this time.

I was using remi repo before and it did not happen.

It seems remi is using a bit different init.d script: http://files.tinypic.pl/i/00455/h1n609bja2xz.jpg

Revision history for this message
Marek Zakrzewski (zakrzewskim) wrote :

I'm on CentOS 6.4 64-bit on kernel 3.10.4-1.el6.elrepo.x86_64

Revision history for this message
bharper (bharper) wrote :

Hello Marek,

Thanks for taking the time to submit this bug. First, I would like to make sure I understand you correctly as it sounds like there might be two different issues.

Issue one:

Something causes PHP fpm to stop responding and 'Internal Server Error' page is getting displayed.

Issue two:

You go to start PHP fpm, but the application did not cleanly shutdown and can not start up. What happens if you just attempt to stop it with the init script? Will it cleanly shut down and allow it to started back up? If you update the init script like in the screenshot, do you have any issues?

Also do you have a cronjob to restart PHP fpm?

-Ben

Revision history for this message
Marek Zakrzewski (zakrzewskim) wrote :

Hello Ben,

Issue One:

Yes - and it hard to diagnose, I have a script that checks if Internal Server Error is showing and if yes the it makes killall -9 php-fpm; pkill -o php-fpm, then /etc/init.d/php-fpm restart

Issue Two:

I try to stop it says [FAILED]. In this case the master process is down, but some of the children are working. If I update my init.d script it did not helped.

I do not have a cronjob to restart php-fpm.

To make things working again, I've switched to php from remi repo and it's solid stable for the last 2 days ;)

Revision history for this message
bharper (bharper) wrote :

Hello Marek,

Sorry for the delay in updating this bug. If the first issue is hard to diagnose, I would assume it is also hard to reproduce. It is difficult to trouble shoot an issue that is hard to reproduce. Do you have a way to reliably reproduce the first issue?

In the meantime, I will try to see what is different between IUS's php fpm and remi's.

-Ben

Revision history for this message
Marek Zakrzewski (zakrzewskim) wrote :

Thank you Ben. I'm using remi repo since last post here and no troubles.

Revision history for this message
bharper (bharper) wrote :

Hey Marek,

Have you been using stock configuration for both IUS and Remi rpms? If not, can you update this bug this your configuration?

-Ben

Revision history for this message
Marek Zakrzewski (zakrzewskim) wrote :
Download full text (6.1 KiB)

This is my config:

;;; begin content - please not remove this line

[PHP]
;### MR -- generic (the same on all php 5.x version)
engine = On
short_open_tag = On
asp_tags = Off
precision = 14
y2k_compliance = On
unserialize_callback_func=
allow_call_time_pass_reference = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_classes =
expose_php = Off
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT
;error_reporting = E_ALL
display_startup_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
report_memleaks = On
track_errors = Off
variables_order = "EGPCS"
gpc_order = "GPC"
include_path = ".:/usr/share/pear/"
doc_root =
user_dir =
extension_dir = /usr/lib/php/modules
upload_tmp_dir = /tmp/
default_socket_timeout = 60
date.timezone = "Europe/Warsaw"

cgi.fix_pathinfo=1
cgi.rfc2616_headers = 1

;### MR -- specific for php 5.3+
auto_globals_jit = On
zlib.output_compression = off
zlib.output_compression_level = 6
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
zend.enable_gc = On
expose_php = Off
max_execution_time = 30
max_input_time = 60
unserialize_callback_func =
output_buffering = 4096
ignore_repeated_source = Off
report_memleaks = On
html_errors = On
auto_append_file =

;### MR -- custom setting (handle by kloxo)
disable_functions = shell_exec
register_globals = off
display_errors = on
file_uploads = on
upload_max_filesize = 256M
log_errors = off
error_log = /var/log/php_error.log
output_buffering = off
register_argc_argv = on
magic_quotes_gpc = off
post_max_size = 128M
magic_quotes_runtime = off
magic_quotes_sybase = off
mysql.allow_persistent = off
max_execution_time = 600
max_input_time = -1
memory_limit = 256M
post_max_size = 128M
allow_url_fopen = on
allow_url_include = on
session.save_path = /dev/shm/session
cgi.force_redirect = on
;sendmail_from =
safe_mode = off
enable_dl = on

;### MR -- deprecated/disabled on php 5.3+
;register_long_arrays = off

[Syslog]
define_syslog_variables = Off

[mail function]
SMTP = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i

[Java]

[SQL]
sql.safe_mode = Off

[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1

[MySQL]
mysql.default_port = 3306
mysql.default_socket = /var/lib/mysql/mysql.sock
mysql.default_host = localhost
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[mSQL]
msql.max_persistent = -1
msql.max_links = -1

[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[Sybase]
sybase.allow_persistent = On
sybase.max_persistent = -1
sybase.max_links = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off

[Sybase-CT]
sybct.allow_persistent = On
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10

[dbx]
dbx.colnames_case = "lowercase"

[bcmath]
bcmath.scale = 0

[browscap]
;browscap...

Read more...

Revision history for this message
Carl George (carl.george) wrote :

Howdy Marek,

I would suggest using the init script to stop the service, instead of using killall or pkill. Using those tools can be useful in emergencies, but routine use can put your system in an inconsistent state between the process, subsys file, and pid file. Even when the init script with a stop command says FAILED, it does clean up work on the subsys file and pid file.

The file you posted appears to be your /etc/php.ini file. Please post your /etc/php-fpm.conf file and any pool configuration files under /etc/php-fpm.d/ so we can try to assist.

Revision history for this message
Marek Zakrzewski (zakrzewskim) wrote :

/etc/php-fpm.conf

[global]
pid=/var/run/php-fpm/php-fpm.pid
error_log=/var/log/php-fpm/error.log
log_level=error

;emergency_restart_threshold=0
;emergency_restart_interval=0
;process_control_timeout=0

emergency_restart_threshold=10
emergency_restart_interval=1m
process_control_timeout=10s

daemonize=yes

include=/etc/php-fpm.d/*.conf

/etc/php-fpm.d/admin.conf

[admin]
;listen = 127.0.0.1:51006
listen = /home/php-fpm/sock/admin.sock
listen.backlog = 65536
listen.allowed_clients = 127.0.0.1
user = admin
group = admin
;pm = dynamic
pm = ondemand
pm.max_children = 16
;pm.start_servers = 8
;pm.min_spare_servers = 4
;pm.max_spare_servers = 8
pm.max_requests = 1000

;pm.status_path = /status
;ping.path = /ping
;ping.response = pong
request_terminate_timeout = 120s
request_slowlog_timeout = 90s
slowlog = /var/log/php-fpm/slow.log
rlimit_files = 2048
rlimit_core = 0
;chroot =
;chdir = /var/www
catch_workers_output = yes
security.limit_extensions = .php .php3 .php4 .php5

env[HOSTNAME] = $HOSTNAME
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp

;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f <email address hidden>
;php_flag[display_errors] = off
php_admin_value[error_log] = /var/log/php-fpm/error.log
php_admin_value[session.save_path] = /var/lib/php/session
php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 64M
php_admin_value[open_basedir] = /home/admin/:/tmp/:/usr/share/pear/:/var/lib/php/session/:/home/kloxo/httpd/script/:/home/kloxo/httpd/disable/
php_admin_value[session.save_path] = /home/admin

Revision history for this message
Carl George (carl.george) wrote :

I'm working on trying to reproduce this issue.

1. Show me your script that runs the killall and pkill commands.

2. Your original error message mentioned the socket /home/php-fpm/sock/mareklipski.sock, but your config file shows you are listening on /home/php-fpm/sock/admin.sock. Did you rename this or is there another configuration file we should be looking at?

3. Can you also show us the output of these commands:

rpm -qa | grep php
netstat -npl | grep php
pgrep -fl php

Changed in ius:
status: New → Incomplete
Revision history for this message
bharper (bharper) wrote :

We are moving bug/ticket/issue tracking from Launchpad to GitHub[0]. All stale tickets within Launchpad are getting closed. If you would like us to re-investigate this issue, please create an issue in the php54 GitHub repository[1].

-Ben

[0] https://lists.launchpad.net/ius-community/msg01635.html
[1] https://github.com/iuscommunity-pkg/php54

Changed in ius:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.