Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • I ISPConfig 3
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 550
    • Issues 550
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 41
    • Merge requests 41
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISPConfig
  • ISPConfig 3
  • Issues
  • #3654

Closed
Open
Created Sep 09, 2015 by Ben Johnson@cbj4074

Syntax error in "Custom php.ini settings" field causes php-fpm to go down; check with FPM's --test

Hello!

While editing a virtual host's "Custom php.ini settings" value, I entered the following, which contains a superfluous and erroneous "&":

[code] error_reporting = E_ALL & & ~E_DEPRECATED [/code]

This is, of course, syntactically invalid. But ISPConfig went ahead and attempted to restart php-fpm anyway, which resulted in a PHP outage across every site on the server, because php-fpm was stopped but never restarted (due to the syntax error that ISPConfig saved to the configuration).

Given that php-fpm has a built-in mechanism for validating its configuration, ISPConfig should make use of this feature.

If ISPConfig is already using "php-fpm --test", then something is not working correctly, because I just tested this very example and it is caught as expected:

php-fpm --test PHP: syntax error, unexpected '&' in Unknown on line 1

[09-Sep-2015 09:56:23] ERROR: Unable to include /usr/local/zend/etc/fpm.d/web4.conf from /usr/local/zend/etc/php-fpm.conf at line 24 [09-Sep-2015 09:56:23] ERROR: failed to load configuration file '/usr/local/zend/etc/php-fpm.conf' [09-Sep-2015 09:56:23] ERROR: FPM initialization failed

Calling "php-fpm --test" returns "0" status code if the configuration is valid, and a non-zero code if it is invalid. This should make it relatively simple to test the configuration before reloading PHP-FPM, rolling-back if necessary.

This is exactly what is done with NGINX and Apache configuration changes, so the same should be applied to other services, such as PHP, wherever possible.

Assignee
Assign to
Time tracking