I am trying to use php GD library to compress jpg images, and some of the answers on stackoverflow says that GD library uses too much memory. So I tried to lower the memory_limit on php.ini and run my script to see if I will encounter any errors. I kept lowering the memory_limit until it hits 128k, and the size of the compressed jpg image is 266 kb. To my surprise, I did not encounter any error. Then, I kept lowering the memory_limit until it reaches 0, and surprisingly, my script can still compressed image without error. I try uploading a 1.3MB image on another script, and it still works, even though memory_limit is set to 0. I checked the path of php.ini at phpinfo to make sure that I am looking at the correct php.ini document. How come changing php.ini has no impact on my php scripts at all?
You have to restart your web server after making a change to the ini file (assuming you have a pretty typical setup). You can use phpinfo() to display the current configuration settings and validate that the changes took effect after restarting the web server.