csv - Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) Error in php even though i gave 1024MB size in php.ini
Get the solution ↓↓↓apologies in advance if answer exist already but i cant seem to find the solution all i want is to convert csv into array and i cant seem to get rid of error no matter how much memory i provide
if (($handle =fopen('price.csv', 'r')) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$array[]=$data;
}
fclose($handle);
}
echo count($array);
csv file is around 3MB with around 1100 lines how do i remove this error i tried allocating memory of 1024MB even .
Answer
Solution:
Please try this in PHP before your Code:
ini_set('memory_limit', '2048M');
You can try whats required it's never a goof idea to modify this value in php.ini, because other PHP processes could eat up your memory.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: object not found by the @paramconverter annotation.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.