Translate

In this Tutorial, We are going to show you how to increase memory limit or max_execution_time. some time we get an error in SQL database while uploading large database or uploading an image with large size throgh file input. In this way database return an error with "Allowed memory size of 103809024 bytes exhausted (tried to allocate 0 bytes)".

for this solution, PHP has some default limitation in its configuration file. for example: - We can upload an image with 2MB or less then to it.
so some times php script stop its execution and shows this error.

So after increasing some value in php.ini file we can correct it like: -

memory_limit = 1000M
max_execution_time = 1000     // by default 300
upload_max_filesize = 10M     // by default 2MB
post_max_size = 240M

memory_limit : Memory limit is required for buffering. If memory limit enabled by the configuration script, then memory_limit also affects on image or file uploading. So, memory limit should be greater than (post_max_size).

upload_max_filesize : The default upload file size is always 2MB. but we can increase it according to the purpose.

post_max_size : (post_max_size) This setting also affects file upload with PHP script. To upload large size file, This value must be greater than upload_max_filesize.

max_execution_time : Obvious, if the file size is large then it will take long time for uploading or execution of php script. so we need to increase it according to execution time.


Some time it do not work and again you will get an error like this. because yo need to correct it at another file and change the max_exection time into it.

Follow the path - >       C:\wamp\apps\phpmyadmin3.5.1\libraries
and select file and open it.      (config.default.php)

Then Search for the keyword with   = $cfg['ExecTimeLimit'] = 300;
Default value for execution is 300. so you need to increase it according to the running PHP script.

like: - $cfg['ExecTimeLimit'] = 300000;

If you still facing any difficulty then feel free to contact me with the help of contact us or if you have any suggestion about any article then you can also write to us.

Happy Coding.

0 comments:

Post a Comment

 
Top