How to stop the major error....
Moderator: General Moderators
-
jclarkkent2003
- Forum Contributor
- Posts: 123
- Joined: Sat Dec 04, 2004 9:14 pm
How to stop the major error....
Hi again,
I'm really busting my butt lately writing php scripts the past week, and keep getting problems.
Sometimes I run a script that takes hours and doesn't output anything at all, and just displays "Cannot display page" error.
I tried adding this:
set_time_limit(9999999999);
ignore_user_abort(1);
but that didn't work either.
Another part of the script has set_time_limit(0);//this may take awhile. so I am hoping that means unlimited and not time out zero seconds.
How can I prevent this script from timing out or breaking? It loops through doing LOTS and LOTS of permutations from a very large file.
I'm really busting my butt lately writing php scripts the past week, and keep getting problems.
Sometimes I run a script that takes hours and doesn't output anything at all, and just displays "Cannot display page" error.
I tried adding this:
set_time_limit(9999999999);
ignore_user_abort(1);
but that didn't work either.
Another part of the script has set_time_limit(0);//this may take awhile. so I am hoping that means unlimited and not time out zero seconds.
How can I prevent this script from timing out or breaking? It loops through doing LOTS and LOTS of permutations from a very large file.
-
jclarkkent2003
- Forum Contributor
- Posts: 123
- Joined: Sat Dec 04, 2004 9:14 pm
php is correct, and i changed set_time_limit to 0.
I'm running this on windows xp pro sp2 with xampp, which lasts way longer than it does on my server.
Does anyone know of a php 2 c (or c++) converter? I get the feeling if I ran this in shell it would work alot better, cuz php always gives me these kinds of problems.
It's a script that will take list.txt and do permutations for each line in the list, and my list is at 1,000 lines, I want it to do permutations for all 1,000 lines and it breaks before it does anything.
What is a way to go about this? I want this as AUTOMATED as possible, so that means, I do NOT want to break the list.txt into 10 files of 100 each (cuz I really see no use for that). It's gotta take one single input list.txt and do permutations until the pc runs out of DISK space, lol........
I'd like to be able to increase the list.txt to 10,000 lines or 20,000 lines would be lovely.
Any ideas?
I'm running this on windows xp pro sp2 with xampp, which lasts way longer than it does on my server.
Does anyone know of a php 2 c (or c++) converter? I get the feeling if I ran this in shell it would work alot better, cuz php always gives me these kinds of problems.
It's a script that will take list.txt and do permutations for each line in the list, and my list is at 1,000 lines, I want it to do permutations for all 1,000 lines and it breaks before it does anything.
What is a way to go about this? I want this as AUTOMATED as possible, so that means, I do NOT want to break the list.txt into 10 files of 100 each (cuz I really see no use for that). It's gotta take one single input list.txt and do permutations until the pc runs out of DISK space, lol........
I'd like to be able to increase the list.txt to 10,000 lines or 20,000 lines would be lovely.
Any ideas?
-
jclarkkent2003
- Forum Contributor
- Posts: 123
- Joined: Sat Dec 04, 2004 9:14 pm
feyd | Please use
ETC..... It goes on and on, it's not a short script. How could one easily convert it into perl or most preferably c / c++, lol, or even visual c++ (not going to right now but maybe in a few months/years) , the goal would be a c script i could compile and run in linux shell (i've done simple things before), or maybe even windows dos prompt.
Thanks in advance
EDIT: there are a few more php functions is uses, preg_match_all, strpos, return and break (not really php heh), $ch = curl_init(); $data = curl_exec($ch) fopen, fwrite, and fclose , so it uses some curl as well. I don't and never really cared for perl but if that's better for this , ok then, but I most prefer to translate into c to run on linux shell enviroment. thanks again so much`
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Here is the script, i modified it a little bit here and there, changed some words and names.
I believe I fixed the error about it timing out, or at least I pray I did. It's been running for two hours and still seems to be loading which is good, I just had to have it display something every 10 seconds or the browser would eventually time out.
Any ideas on how to easily convert this to C or Perl (perferably c)?
I can give a few snippets (edited variable names of course)Code: Select all
class MYFUNCTION
{
var $PROXY_LIST=false;
var $CURRENT_PROXY=false;
var $useProxies=false;
var $proxyPath = 'proxies.txt';
var $max_out = 100000;
var $time_delay = 1;
var $extra_bar=0;//0= no limit
var $named_list=null;
var $stopat=null;
var $fileName ="whatisthefilename.txt";
var $fileMode ="w";
var $numRequests=0;
function GoForIt()
{
set_time_limit(0);//this may take awhile.
$totalsize=9;
$i=0;
$d=0;
while($i < $totalsize && $d <= $this->depth)
{
if($this->useProxies)
$this->GetNextProxy();
$this->ANOTHERFUNCTIONHERE($this->named_list[$i]);
$totalsize = count($this->named_list);
if($max_out >= $this->extra_bar)
break;
if($this->depth>0)
$d++;
$i++;
sleep($this->time_delay);
}
$this->SaveToFile();
}
/********************************************************************
* Get the next anonymous proxy from the proxies.txt file
* When the last proxy is reached it goes back to the first
* proxies should be just the proxy ip and port and a new line
*********************************************************************/
function GetNextProxy()
{
// if the current_proxy is false, then load the proxy file
if(!$this->CURRENT_PROXY)
{
$handle = fopen($this->proxyPath, "rb");
if($handle == false)
{
echo "Please upload a proxy list. or untick the proxy list, moron!";
exit;
}
elseif ($handle == true)
{
$this->PROXY_LIST = fread($handle, filesize('proxies/proxies.txt'));
fclose($handle);
$this->PROXY_LIST = explode("\n", $this->PROXY_LIST);
$this->CURRENT_PROXY = current($this->PROXY_LIST);
}
}
else
{
//get the next proxy from the array
$this->CURRENT_PROXY = next($this->PROXY_LIST);
//if used all proxies then get the first proxy
if(!$this->CURRENT_PROXY)
$this->CURRENT_PROXY = reset($this->PROXY_LIST);
}
}
function BLAHBLAHBLAH($result)
{
if(is_array($result))
foreach($result as $value)
{
$value = strip_tags($value);
$value = trim($value);
if (!in_array($value,$this->named_list))
{
if($this->stopat!=null && $this->stopat($value))
$this->named_list[] = $value;
else
$this->named_list[] = $value;
}
}
}Thanks in advance
EDIT: there are a few more php functions is uses, preg_match_all, strpos, return and break (not really php heh), $ch = curl_init(); $data = curl_exec($ch) fopen, fwrite, and fclose , so it uses some curl as well. I don't and never really cared for perl but if that's better for this , ok then, but I most prefer to translate into c to run on linux shell enviroment. thanks again so much`
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]