Skip to content

GitLab

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

Closed
Open
Opened 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
Planned features
Milestone
Planned features
Assign milestone
Time tracking
None
Due date
None
Reference: ispconfig/ispconfig3#3654