I'm using Goutte 4.0.0, and when iterating over multiple thousand links using php artisan command, it quickly takes up memory and eventually throws a memory limit error. It throws this:
PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 16777224 bytes) in /home/forge/project/vendor/symfony/browser-kit/History.php on line 38
In History.php line 38:
Allowed memory size of 536870912 bytes exhausted (tried to allocate 16777224 bytes)
Here is my code:
$client = new Client();
foreach($links as $link){
$crawler= $client->request('POST', $link);
// Commit to Database
}
I tried running with a --env=prod but it doesn't work.
I'm using
Goutte 4.0.0
, and when iterating over multiple thousand links usingphp artisan command
, it quickly takes up memory and eventually throws a memory limit error. It throws this:Here is my code:
I tried running with a
--env=prod
but it doesn't work.