I'm trying to create a Java file using a PHP script, but for some reason, whenever I run this script I get the following error on the screen:
Fatal error: Allowed memory of 134217728 bytes exhausted (tried to allocate 24 bytes) in C:\filepath\file.php on line 88
This is the code block with line 88:
$var1 = explode(".", $filenamee);
$var2 = explode(".", $folder);
$filename = "extfiles/".$var2[0]."/".$var1[0].".java";
$file = fopen($filename, "c");
$lines_array = array();
while (!feof($file)) {
$line = fgets($file);
array_push($lines_array, $line); // This is line 88
}
I tried to change the memory limit in php.ini
from 128MB to 512MB, but that didn't work. I also tried to set memory limit on the code by using this:
ini_set('memory_limit', '512MB');
But that didn't work either.
What can I do to fix this?