Page 1 of 1
[56K Warn] multiple instances of php-cgi.exe
Posted: Thu Apr 12, 2007 1:31 pm
by benyboi
Anyone know why there are multiple instances of php running (img below)?
I can give code of the page which i think is causing the problem if you need?
http://www.dedicatedlost.com/images/other/php.jpg
thanks!
feyd | no need to show a 113K image
Posted: Thu Apr 12, 2007 1:44 pm
by Luke
when you post images that large, please put [56k Warn] in your thread title. Some people still use dial-up believe it or not.
Posted: Thu Apr 12, 2007 1:53 pm
by benyboi
oh rite sorry, thanks for letting me know.
Posted: Thu Apr 12, 2007 1:58 pm
by RobertGonzalez
How many apache instances are running?
Posted: Thu Apr 12, 2007 2:00 pm
by benyboi
httpd.exe? 2 of them
1 using 30MB memory, the other using 3MB
Posted: Thu Apr 12, 2007 2:07 pm
by RobertGonzalez
That is odd. How come you are not running PHP as an Apache module?
Posted: Thu Apr 12, 2007 2:15 pm
by benyboi
this is what i have in my apach conf file:
Code: Select all
ScriptAlias /php/ "c:/php5/"
Action application/x-httpd-php /php/php-cgi.exe
AddType application/x-httpd-php .php
Posted: Thu Apr 12, 2007 2:22 pm
by RobertGonzalez
This is what I have in mine.
Code: Select all
# Added by Robert to allow for PHP5 use
# For PHP 5 do something like this:
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/php"
Posted: Thu Apr 12, 2007 2:35 pm
by benyboi
i tried that but its saying the module cant be loaded because the file cant be found, even though i have it?
Posted: Thu Apr 12, 2007 3:02 pm
by aaronhall
Download the binary, place the unzipped folder somewhere, and point to that folder from the LoadModule directive (php5apache2.dll is in the root dir).
Posted: Thu Apr 12, 2007 3:08 pm
by benyboi
yup, tried that:
and i have the file:
could the multiple instances of php-cgi.exe have anything to do with this page (hotlink prevention page):
Code: Select all
<?php
$file=$_GET['file'];
$ref=($_SERVER['HTTP_REFERER']);
$valref=substr($ref, 0, 29);
if($valref == "http://www.xxxxx.com/"){
$stat=stat('D:/inetpub/files/xxxxx/' . $file);
header('Content-Disposition: attachment; filename=' . $file);
header('Content-Length: '.$stat[7]);
header('Pragma: no-cache');
header('Cache-Control: no-cache, no-store, must-revalidate');
readfile('D:/inetpub/files/xxxxx/' . $file);
}else{
if($valref == ""){
?>
There is a problem with your referer.<p>
This means your browser has not told us where you got this link from.<p>
Please check <a href="http://www.xxxxx.com/viewforum.php?f=64">help</a> for more info.
<?
}else{
// Your email address
$email = "info@xxxxx.com";
// The subject
$subject="Invalid referer for video download";
// The message
$comment=$ref;
// The message
$emailfrom= "info@xxxxx.com";
mail($email, $subject, $comment, "From: $emailfrom");
?>
Hotlinking? Tut tut. You really shouldn't...
<p>
We have recorded which website sent you here and will be taking action.
<p>
If this message has been received in error, please goto our <a href="http://www.xxxxx.com/viewforum.php?f=64">help</a> section to find out why.
<p>
Otherwise you can goto our <a href="http://www.xxxxx.com/">main site</a> to get the download.
<?
}
}
?>
thanks
Posted: Thu Apr 12, 2007 3:15 pm
by aaronhall
If configured as a CGI-binary, Apache will spawn an instance for every request... I'm just not sure why they aren't terminating.
Posted: Thu Apr 12, 2007 3:35 pm
by benyboi
the script above is used for files that are about 350MB, could it be something to do with that or maybe if the download is cancelled during the download?