php5.cgi becoming corrupted

Jamie -- I thought this was a fluke when I saw it once, but it just happened a second time...

Somehow or another, the cgi-bin/php5.cgi file is becoming corrupted. It still has the immutable attribute set, so it's not a user just messing around with the file itself.

After becoming corrupted, the file looks like this (note the "exec" line at the bottom):

#!/bin/bash
ulimit -t 7200
ulimit -u 20
PHPRC=$DOCUMENT_ROOT/../etc/php5
export PHPRC
umask 022
exec

Looking in the miniserv.error log, I do see that the user who owns that domain was doing some work within Virtualmin... I see these entries at the time of the problem:

90.185.96.178 - educase [05/Jan/2010:08:56:26 +0100] "GET /virtual-server/rename_form.cgi?dom=126114520827242& HTTP/1.1" 200 3163
89.221.166.38 - root [05/Jan/2010:08:56:29 +0100] "POST /fastrpc.cgi HTTP/1.0" 200 47
89.221.166.38 - root [05/Jan/2010:08:56:34 +0100] "POST /fastrpc.cgi HTTP/1.0" 200 47

The above issue causes the site to produce 500 errors until restoring the original php5.cgi file.

Status: 
Closed (fixed)

Comments

That sounds like a bug ..

If you check the last-modified date on that file, which action in the logs most closely matches it?

The last-modified time is 08:56, so it potentially matches all 3 of the above lines.

The rename seems more likely to be the cause .. although it is just the rename form that was loaded it seems. If you go to Webmin -> Webmin Actions Log, is any event logged around that time?

Hi Jamie -- there's two recent actions in the Actions Log (the only two today, actually), but nothing around the time the problem occurred this morning.

Ok, I think I see how this could happen .. I'll fix it in the next Virtualmin release (3.77)

Great!

Being as this occurred twice in the last week for this fellow, is there something he can do (or perhaps something he should avoid doing) in order to prevent the issue from happening again until 3.77 comes out?

Thanks!

I guess avoid renaming any domains. Or I can send you a small patch if you like?

A patch would be super... thanks!

Just edit virtual-server/php-lib.pl , and after line 425 which contains :

foreach my $v (&list_available_php_versions($d, $mode)) {

add the line :

        next if (!$v->[1]);

Automatically closed -- issue fixed for 2 weeks with no activity.