While trying to debug a different problem, I created an HTML file with the following content:
<body>
Try 1:<iframe style='height:60px;' src='return_test1.php' ></iframe><br/>
Try 2:<iframe style='height:60px;' src='return_test2.php' ></iframe><br/>
Try 3:<iframe style='height:60px;' src='return_test3.php' ></iframe><br/>
Try 4:<iframe style='height:60px;' src='return_test4.php' ></iframe><br/>
Try 5:<iframe style='height:60px;' src='return_test5.php' ></iframe><br/>
Try 6:<iframe style='height:60px;' src='return_test1.php' ></iframe><br/>
Try 7:<iframe style='height:60px;' src='return_test2.php' ></iframe><br/>
Try 8:<iframe style='height:60px;' src='return_test3.php' ></iframe><br/>
Try 9:<iframe style='height:60px;' src='return_test4.php' ></iframe><br/>
Try 10:<iframe style='height:60px;' src='return_test5.php' ></iframe><br/>
</body>
Each of the scripts (return_test1.php to return_test5.php) contain just the following code:
<?php
echo "SUCCESS";
?>
The problem is that opening the HTML file some of the iframes show the expected “SUCCESS” output, but others show “Internal Server Error“. These change with every refresh of the page.
Looking at the cPanel server logs, there’s the error “Cannot allocate memory: couldn’t create child process”. Looking at the resource statistics, the used memory goes up to 1 GB when opening the HTML file.
I tried the code on other servers and of course it ran with no problems.
I should also mention that opening one of the PHP scripts directly always produces good results. They only fail when called simultaneously.
The site is on shared hosting and has very little traffic. The company doing the hosting hasn’t been helpful and it seems the only solution would be to move to another hosting provider.
Does anybody know what might cause the problem? Or something I can suggest to the hosting people to check on the server configuration?
We ended up changing the hoster.
A day after the change we got a message from the old hoster saying they fixed the problem after consulting with the makers of cPanel and cloudLinux. Apparently it was an issue that affected very few users and it was fixed with a custom patch “on the resource management part” (sorry, I don’t know the exact details).