![]() |
PHP help
Quote:
|
P.H.P = Pretty Hard Poo...
Need Help? Take Stool Softener / Laxative Your Welcome /thread |
Quote:
|
Quote:
|
This error message can spring up in a previously functional PHP script when the memory requirements exceed the default 8 MB limit. However, do not fret because this is an easy problem to overcome.
To change the memory limit for one specific script, include a line such as this at the top of the script: Code:
ini_set("memory_limit","12M"); You can also make this a permanent change for all PHP scripts running on the server by adding a line such as this to the server?s php.ini file: Code:
memory_limit = 12M |
Quote:
|
You read the while damn file into memory instead of 1K at a time in a loop. If you DID loop, PHP read the whole damn file into memory anyway because while PHP 5 sucks far less than PHP 4, it still sucks awefully bad. Turn off output buffering.
Because the script is called file.php, I bet the code is the same as every other script with that name. Actually there are two versions of it - one that takes a filename as it's argument, and one that takes a file ID, which is then looked up in a database. If you're passing a filename, a bad guy can pass ../.../cgi-bin/.htpasswd or whatever and get any file they want. Fix that, then fix better because your first try will still leave you vulnerable. |
BTW the second thing Harmon said applies in this case. You do not want to increase the memory limit. If you're reading more than 36 MB into RAM at once, you're doing it wrong.
|
All times are GMT -7. The time now is 04:02 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123