I have this CentOS 6.9 VPS server with cpanel and WHM, running Apache 2 with PHP 5.6

Ive enabled PHP-FPM on WHM and it shows as active in both WHM and Cpanel (in the MultiPHP manager sections)

To be sure, I even copied it to the conf where Im setting my vhost.

And PHP-FPM seems to be running, according to its logs ("NOTICE: ready to handle connections" on the php-fpm error.log)

But when I go see phpinfo(), it still says:

Server API CGI/FastCGI

So what am I missing? How to debug this? Ive restarted apache and php-fpm many times, and even rebooted the server, to no avail

EDIT: actually, I was wrong: I didint have that on my vhost config:

<IfModule proxy_fcgi_module>
<FilesMatch \.(phtml|php[0-9]*)$>
SetHandler proxy:unix:/opt/cpanel/ea-php56/root/usr/var/run/php-fpm/fc680a9025c37fd635d3cad33dda11786afdf8c0.sock|fcgi://domain.tld

It must have been overwrote by something. Now if I place it there I get an error:

No input file specified.

Even when I try to access the script with just phpinfo() on it


cPanelMichael gives an answer at this cPanel forum page that might help to clarify: https://forums.cpanel.net/threads/php-handlers-in-easyapache4.592879/

Essentially, the way PHP-FPM is implemented in cPanel at the moment, it can only be enabled per domain, but isn't actually available as a global or system-wide PHP handler. So globally, you can have DSO, suPHP, or fcgi as your global handler, but then be able to enable PHP-FPM for a specific domain. However, if phpinfo(), when called from the domain for which you've enabled PHP-FPM, isn't showing any evidence of PHP-FPM working for that domain, then there may be an issue that a systems administrator at your data host with root access to your server would be in a much better position to investigate.

Does your phpinfo() at least show --enable-fpm or --with-fpm-systemd in the Configure Command section? Does php-fpm show as 'active' under the cgi-fcgi section further down the phpinfo() page? Is there a fpm.config directive? I'd say if you find at least the configure command options, you might be fine. If Ctrl+F -> 'fpm' doesn't return any results, however, again I'd contact the technical support at the data hosting company you're hosting your cPanel account with.

  • no to everything, no mention of fpm anywhere on the info. Ill keep trying a bit more (I do have root access for the VPS) – diogo.abdalla Feb 2 '18 at 20:17
  • also, my description of the problem was wrong, Ive updated the question. Please see if that provides any useful information – diogo.abdalla Feb 2 '18 at 20:20
  • If your vhost config is in the main httpd.conf, your changes are liable to get overwritten by cPanel updates without proper distillation of the Apache configuration (which is a term used to describe the process of informing cPanel of your changes so that cPanel preserves them across rebuilds). However, in a functional cPanel environment, it shouldn't be necessary to manually set PHP-FPM in that way. If Enabling it in the multiphp section of WHM, or from within a domain's cPanel, is failing, then a vhost entry is a workaround at best. Are you accessing phpinfo() from the domain your testing? – gluonman Feb 2 '18 at 20:30
  • yep, from the same domain. Ive tried to manually set PHP-FPM because just activating it from the pannel wanst working. Also,l Ive separated my vhosts from the http.conf now – diogo.abdalla Feb 2 '18 at 21:13
  • Even separating out your vhosts from the main config file, you probably have to place an include statement in your main config file, which itself could get overridden. I also manage a cPanel server, and I avoid directly modifying the Apache configuration and simply make changes to it through the WHM interface, so that my changes are preserved in cPanel's config templates. Must you make a direct mod to the Apache conf without going through cPanel, run '/usr/local/cpanel/bin/apache_conf_distiller --update' afterward, but even that no longer guarantees cPanel won't overwrite your changes ever. – gluonman Feb 2 '18 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.