When working with PHP scripts, I usually do not have to bother with the underlying system. Today, I have to.
A PHP script (cronjob) that has worked fine is crashing since 2 days ago. The cronjob mail as well as running the script via shell both say:
Bus-Zugriffsfehler (Speicherabzug geschrieben)
If running the same script via PHP-FPM (via nginx) I receive a Bad Gateway which probably means "I have crashed, leave me alone", as well.
Unfortunately, I have no idea how to find more information, let alone, solve the problem. I have already checked the syslog (nothing related to the issue), dmesg
(nothing) and the PHP error log (nothing). I also have reinstalled php5-cli, php5-pfm, and even libc6 and restarted the server -- no effect.
By the way: The whole thing is running on a virtual server (VPS), which also limits the chances of a hardware error. PHP has been updated to php5-cli (5.5.9+dfsg-1ubuntu4.7) recently, but the script worked fine after that for 9 days and two reboots...
Any ideas? Thanks a lot!
BurninLeo
EDIT: Solution
Of course, regularly sending echo
from the PHP script is not elegant - but it helps to track problems to function calls. And, of course, the one seeking help did touch something, when he told he did not...
The solution was quite simple: A static class method called itself in the first line:
class ServerManager {
public static function dropCache() {
ServerManager::dropCache(); // VERY STUPID
foreach (array('active', 'packed', 'old') as $class) {
$cacheID = 'cache-'.$class.'-0';
Cache::drop($cacheID);
}
}
}
Well, maybe PHP could have been a bit more specific in the cause of the problem. Yet, removing this one solved the problem.
0 Answers