ANS Documentation

Improve This Doc
  • Cloud
  • Desktop and Office Solutions
  • Domains and DNS management
  • Backup and High Availability
  • eCommerce Stacks
  • Security
  • Email
  • Monitoring and usage management
  • Networking
  • Operating systems
    • Linux
      • Basics
      • Apache
      • Control Panels
      • FTP
      • Magento
      • Miscellaneous
      • MySQL
      • NGINX
      • PHP
      • PHP-FPM
      • Setting up Websites
      • NFS
      • VPN
      • Percona
      • SSH
      • SSL
      • Git
      • Redis
      • Elasticsearch
      • MongoDB
      • Ncdu
    • VMware ESXi
    • Windows
  • Webcelerator
  • MyUKFast
  • Home >
  • Operating systems >
  • Linux >
  • PHP-FPM >
  • PHP-FPM

PHP-FPM¶

Error Log¶

The error log for the PHP-FPM service is:

/var/log/php-fpm/error.log

Config File¶

The main configuration file for PHP-FPM is:

`/etc/php-fpm.conf`

This file has an include to /etc/php-fpm.d/*.conf:

~]# grep include /etc/php-fpm.conf
include=/etc/php-fpm.d/*.conf

Domain Error Log¶

The error log for your domain is located just outside of the document root:

/var/www/vhosts/domain.com/domain.com-phpfpm-error.log

This error log should be reviewed regularly as you may see PHP errors in this file.

Domain Config File¶

The PHP-FPM configuration pool for your domain is located in /etc/php-fpm.d/

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

Enable Core Dumps¶

PHP-FPM may log a SIGSEGV error in the service’s error log file, example:

WARNING: [pool poolname] child 20196 exited on signal 11 (SIGSEGV) after 6.772815 seconds from start

Enabling core dumps can help to debug and find the cause of the SIGSEGV.

If you need to enable core dumps you can run the below commands:

echo '/tmp/core-%e.%p' > /proc/sys/kernel/core_pattern
echo 0 > /proc/sys/kernel/core_uses_pid
ulimit -c unlimited
sysctl fs.suid_dumpable=2

Then set the rlimit_core directive in the PHP-FPM configuration pool (/etc/php-fpm.d/domain.conf) to unlimited:

rlimit_core = unlimited

Restart PHP-FPM and check the error log file for the SIGSEGV, you should now see Ccore dumped:

WARNING: [pool poolname] child 20196 exited on signal 11 (SIGSEGV - core dumped) after 6.772815 seconds from start

Core dumps should now be generated by PHP-FPM in the directory /tmp/. You may need to install gdb (yum install gdb) so you can read the core dump file with the command gdb $program-path $coredump-path. Example:

gdb /usr/sbin/php-fpm /tmp/coredump-php-fpm.1594

Once in the gdb prompt the bt command will show you the PHP backtrace on the moment of the core dump. To exit gdb, just type quit.

Next Article > Installing and Configuring PHP-FPM

  • Useful Links
  • SMB
  • Enterprise
  • Channel
  • Public Sector
  • ANS Data Centres
  • About ANS
  • Careers
  • Blog
  • Get in touch
  •  
  • Sales 0800 458 4545
  • Support 0800 230 0032
  • Get in touch

© ANS Group Limited | Terms and Conditions | Corporate Guidance | Sitemap
ANS Group Limited, registered in England and Wales, company registration number 03176761, registered office 1 Archway, Birley Fields, Manchester M15 5QJ