Thanks PallaviDalvi. I figured it out last night. I was opening the text files in the wrong order 😕
Now it works great, but I kept getting a error saying the script went over the max time. I bumped max _execution_time=100, 1000, and now it's at 100000. I let it run all night and when I woke up this morning I had a "grsec:attempted resource overstep by requesting xxxxxxxxxx for RLIMIT_FSIZE against limit xxxxxxxxxx. I tried to looking this up and can't find anything. I have memory_limit= 32M. Now I am stuck again.
The two text files, 559super.txt has 6300 entries, and dncsuper.txt has 164000 entries. Fixed width, one entry per line.
ex:
5595551212
5595551212
5595551212
5595551212
5595551212
5595551212
5595551212
5595551212
5595551212
5595551212
5595551212
5595551212
My server is a pieced together AMD 400 mhz dinosaur with 256 MB of ram. Am I doing more than my server can handle, or going beyond the limits of the code? I calculated it compares the numbers 1.2 billion times (could be way off though), and each entry in the 559super.txt file takes approx. 17 seconds to do the check against the entries in the dncsuper.txt.
Code has been rewritten to this:
<?php
$numtextfile = "559super.txt";
$ntf = fopen($numtextfile, "r") or die("Couldn't open $numtextfile");
while (!feof($ntf)) {
$numberchunk = fgets($ntf, 11);
$junkchunk1 = fgets($ntf, 1024);
$numberchunk1=ereg_replace("[0-9]","",$numberchunk);
$dncfile = "dncsuper.txt";
$df = fopen($dncfile, "r") or die("Couldn't open $dncfile");
while (!feof($df)) {
$dncchunk = fgets($df, 11);
$junkchunk = fgets($df, 1024);
$dncchunk1=ereg_replace("[0-9]","",$dncchunk);
if ($numberchunk1 === $dncchunk1) {
echo "$numberchunk<br>";
}
}
}
?>
I would like to apologize for my title of the thread, I know it wasn't very specific. I tried to change it, if a mod can change the title to "GRSEC error" or "dummy screwed his IF statement" I would appreciate it
😃