[56K Warn] multiple instances of php-cgi.exe

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

[56K Warn] multiple instances of php-cgi.exe

Post 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
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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.
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

Post by benyboi »

oh rite sorry, thanks for letting me know.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

How many apache instances are running?
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

Post by benyboi »

httpd.exe? 2 of them

1 using 30MB memory, the other using 3MB
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

That is odd. How come you are not running PHP as an Apache module?
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

Post 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
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post 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"
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

Post by benyboi »

i tried that but its saying the module cant be loaded because the file cant be found, even though i have it?
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post 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).
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

Post by benyboi »

yup, tried that:

Image

and i have the file:

Image


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
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post 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.
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

Post 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?
Post Reply