Apache & PHP-FPM troubles
I have a cPanel system that is a new install, then it got a backup from a very old (PHP 7.2) system restored over it. There are lots of PHP bugs and I've been trying to get Xdebug to work remotely with VSCode. Today while working on this I made one little change to php.ini and now the whole thing has gone sideways on me.
I was editing here:
/opt/cpanel/ea-php82/root/etc/php.ini
Trying to add these
;[xdebug]
;xdebug.mode=debug
; gratuitously catches ALL system activity
;xdebug.start_with_request=yes
; just catch stuff debugger asks for
;xdebug.start_with_request = trigger
;xdebug.client_host=127.0.0.1
;xdebug.client_port=9003
;xdebug.log=/var/log/xdebug.log
;zend_extension=xdebug.so
I restarted Apache and PHP_FPM, and I am getting this message almost all the time.
httpd.service: Can't open PID file /run/apache2/httpd.pid (yet?) after start: Operation not permit
There are a LOT of Google results on this, it all comes down to permissions on that folder. The curious 710 flags was suggested, I've tried it other ways, but the PID file is written by root.
drwx--x--- 3 root nobody 100 Feb 2 11:59 apache2
This is what happens after restarting httpd.
srwx------ 1 nobody root 0 Feb 2 12:06 cgid_sock.14918
drwxrwxrwx 2 nobody nobody 40 Feb 2 10:39 htcacheclean
-rw-r--r-- 1 root root 6 Feb 2 12:06 httpd.pid
And then FPM starts acting up. This is all systemctl status reports, I found the log file for it and it's equally uninformative.
Feb 02 11:38:49 host.my.net systemd[1]: Starting Apache PHP-FPM services...
Feb 02 11:38:50 host.my.net systemd[1]: apache_php_fpm.service: Deactivated successfully.
Feb 02 11:38:50 host.my.net systemd[1]: Finished Apache PHP-FPM services.
At one point both Apache and FPM were running as expected. I went back to trying to get Xdebug to talk to VSCode, restarted FPM service, and now it's just wrecked. I just rebooted, Apache comes up unable to read its PID file. FPM is not starting at all.
I opened a ticket almost three hours ago. Tech popped in during the five minutes when both Apache/FPM *were* back, haven't seen a thing since.
(Background: the old machine was intruded bigly. The backup was restored to the new one, Thor Lite scanner was applied, and we had another trial machine we setup to get SHA256s. There was a bunch of spammer config stuff in Exim conf, otherwise nothing odd was showing. It's locked down tight with /etc/hosts.allow, ModSecurity is active, customer domains are all behind Cloudflare, csf rules only permit 80/443 to talk TO Cloudflare ... so we don't think this is some intrusion artifact. This was all working more or less fine, until those minor php.ini changes.)
-
This shows up in a system email indicating FPM is running ... but it's not. My system does not have a /var/log/messages, it's using /var/log/syslog for that role. I created /var/log/messages chmod 777, rebooted, and it remains empty.
The system could not provide log messages for “apache_php_fpm” because it failed to read all of the potential log files with the following errors: Error while attempting to open “/var/log/messages”: “No such file or directory”, Error while attempting to open “/var/log/secure”: “No such file or directory”
0 -
Hey there! You mentioned you were able to make a ticket - could you share that number here?
0 -
Thanks for the reply - I made a ticket, then I made a terrible mess, and someone from tech support bailed me out. The client we could not afford to lose has been serviced, and we're on to the next big thing.
David, the owner of this account, is the PHP developer and VSCode user. I'm the heavy lifting with Linux guy, and what little programming I do has been Python/PyCharm, so I got thrown to the wolves on this job.
I would still like to get Xdebug running remotely, just for my own knowledge of the subject. The results on this are very confusing to me, they all seem to presume knowledge that I, as a back end/CLI kinda guy, do not have.
Is there a good write up out there that covers how to do this?
0 -
Since things are working well now, and it required a ticket intervention, it might be best to ask in the ticket since that person would know what specifically went wrong with the system.
We have details on how you can make this change, but it requires being the root user of the user: https://support.cpanel.net/hc/en-us/articles/18016933276567-How-to-install-Xdebug-using-the-command-line
0
Please sign in to leave a comment.
Comments
4 comments