r/PHPhelp • • Dec 05 '25
PHP keeps going down on my server
Morning All,
So I have a dedicated server. I currently only have 3 sites on it.
Site 1 - php v8.2.29
Site 2 - php v8.3.28
Site 3 - php v8.3.28
I've recently launched site 3, since launching site 3, site 1 seems to be crashing. I bring it back by restarting php 8.2.29 and its back up and working within seconds. I was thinking there is some rogue code on site 3 thats causing the site to loop and crash, however is there anyway that there could be some bad code on site 3, that would crash out site 1?
I'd assumed as its different php versions if its affected site 1 then it must be something with site 1?
I'm clearly just clutching at any reason for site 1 to be having issues...
11
u/thewallacio Dec 05 '25
What do you mean by crashing? Do you mean the php-fpm process? Your logs should tell you all you need to know. Check site error logs, apache/nginx/php-fpm logs. Could be something as simple as an OOM, but you'll likely find your answer in one of those.
2
u/[deleted] Dec 05 '25
oh sorry, ok, so I have a dedicated server:
Type: Dedicated Server XL-64
CPU: 4 Core x 3.8 GHz (Intel Xeon E3-1270 v6)
RAM: 64 GB
HDD: 2 x 2000 GB Hardware RAID 1
AlmaLinux 9 running Plesk Obsidian (Unlimited Domains)
So I set up the domain and set the php version for each domain within plesk.
I've looked at the site debug logs and nothing is showing. I emailed the server support team who said:
If the website goes down again, please contact us immediately so we can investigate the issue and identify the root cause.
However it can take several hours for the support team to respond, so I don't want to just leave the site down.
Are there any logs i can look at directly to see if I can see anything happening?
7
u/equilni Dec 05 '25
Did you review any logs to see why it crashed?
4
u/Own-Perspective4821 Dec 05 '25
That is not all the necessary info. How do you run these different PHP Versions on your single server?
4
u/oscurochu Dec 05 '25
This sounds like a standard resource contention issue between the FPM pools, specifically regarding the FastCGI process manager. When you spin up a new instance on a dedicated box, you have to ensure the pm.max_children settings aren't exhausting shared memory, which often forces the older version to terminate its processes prematurely to free up handles.
That said, if PHP keeps going down on your server, you should probably just knock before entering the terminal. It’s clearly a very intimate relationship. Most sysadmins have to pay extra for that kind of service, so I’d suggest you just let them finish and offer the server a towel.
1
u/divdiv23 Dec 06 '25
Looks like most suggestions have already been made with regards to PHP but just a sidenote about traffic would be a recommendation to route DNS through Cloudflare in proxy mode to benefit from caching. Also on the first paid tier the analytics tools to analyse traffic are super good
A while back I had a site that was getting flooded by requests from crawlers and I ended up blocking certain requests, it saved my life
1
u/Zeal0usD Dec 05 '25
Have you manually configured everything or using cPanel/cloudpanel?
Checked logs across the board. If it’s code it will leave a trace
1
u/ITGuy424242 Dec 05 '25
I’ve been having this same issue for the past few days in php 8.3, nothing in the logs at all, it just starts serving up blank pages until I reset pho-fpm
Haven’t been able to work out what’s going on since there’s nothing in the lots
1
u/bobthenob1989 Dec 06 '25
Rule 34
1
u/FreeLogicGate Dec 06 '25
The new site is going to be a new pool in the master php-fpm process for 8.3. You already have a log that shows you the demand for php-fpm child processes on the 8.2 site exceeded demand, so you should increase that parameter.
One other thing I would suggest you look at is the opcache configuration for php 8.3.
Pure conjecture on my part, but opcache is using shared memory on the server. There will be one shared memory segment per php version, so when you added this new version, you have put additional pressure on the opcache. If it is now under-sized, you might be having issues where the opcache is resetting continuously. You should look at the opcache settings for the 8.3 installation and possibly may increase those.
Why would this affect the 8.2? If the 8.3 version is locking up shared memory to the point that the 8.2 process can't get access to it for long periods of time, that could explain why 8.2 appears to be hung -- as it could be waiting to read its share memory block and being locked out.
You could test this hypothesis by disabling opcache in the 8.2 configuration and seeing if the apps run without issue. I don't know if you have any opcache monitoring setup but you might look at projects like https://github.com/RobiNN1/phpCacheAdmin or the older but much used https://github.com/amnuts/opcache-gui
The important thing you're trying to determine is what files are being cached, particularly in the 8.3 opcache.
1
u/ErikThiart Dec 09 '25
post logs
1
u/insight_designs Jan 27 '26
The most likely cause: Site 3 is exhausting server memory or CPU, which causes the OS to kill PHP-FPM processes, including Site 1's PHP 8.2 pool. The fact that a simple restart brings it right back supports this — nothing is actually broken, it's just getting killed.
Things to check:
0
u/invisibo Dec 05 '25
There’s a couple different options you can go with, but you need some sort of observability.
New Relic is a good one that has a free tier. I use Sentry on my personal stuff and Datadog at my day job. Don’t use Datadog unless money is not an object. The software is great and easy-ish to use but good god is it expensive.
Once you get any one of those setup, it makes tracing problems like this exponentially easier.
0
u/half_man_half_cat Dec 05 '25
Docker
-2
u/[deleted] Dec 05 '25
Use Frankenphp in docker