Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-16-2012, 04:56 AM   #1
seeandsee
Check SIG!
 
seeandsee's Avatar
 
Industry Role:
Join Date: Mar 2006
Location: Europe (Skype: gojkoas)
Posts: 50,945
PHP help

Quote:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes) in file.php on line 52
How to fix this, was working fine, but now i get this error? Thanks!
__________________
BUY MY SIG - 50$/Year

Contact here
seeandsee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-16-2012, 04:58 AM   #2
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 38,534
P.H.P = Pretty Hard Poo...

Need Help?

Take Stool Softener / Laxative

Your Welcome

/thread
__________________


👁️ 👍️ 💩
CurrentlySober is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-16-2012, 05:02 AM   #3
seeandsee
Check SIG!
 
seeandsee's Avatar
 
Industry Role:
Join Date: Mar 2006
Location: Europe (Skype: gojkoas)
Posts: 50,945
Quote:
Originally Posted by CurrentlySober View Post
P.H.P = Pretty Hard Poo...

Need Help?

Take Stool Softener / Laxative

Your Welcome

/thread
__________________
BUY MY SIG - 50$/Year

Contact here
seeandsee is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-16-2012, 05:05 AM   #4
CurrentlySober
Too lazy to wipe my ass
 
CurrentlySober's Avatar
 
Industry Role:
Join Date: Aug 2002
Location: A Public Bathroom
Posts: 38,534
Quote:
Originally Posted by seeandsee View Post
i came..
__________________


👁️ 👍️ 💩
CurrentlySober is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-16-2012, 05:07 AM   #5
Harmon
( ͡ʘ╭͜ʖ╮͡ʘ)
 
Harmon's Avatar
 
Industry Role:
Join Date: Mar 2004
Posts: 19,998
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");
The 12M sets the limit to 12 megabytes (12582912 bytes). If this does not work, keep increasing the memory limit until your script fits or your server squeals for mercy.

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
Keep in mind that a huge memory limit is a poor substitute for good coding. A poorly written script may inefficiently squander memory which can cause severe problems for frequently executed scripts. However, some applications are run infrequently and require lots of memory like importing and processing a large data file.
__________________
[email protected]
Harmon is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-16-2012, 05:08 AM   #6
notjoe
Confirmed User
 
Industry Role:
Join Date: May 2002
Location: Toronto, Canada
Posts: 5,599
Quote:
Originally Posted by seeandsee View Post
How to fix this, was working fine, but now i get this error? Thanks!
Your script is using too much memory. You can either write better code or increase the amount of ram that php is able to consume.
notjoe is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-16-2012, 05:10 AM   #7
raymor
Confirmed User
 
Join Date: Oct 2002
Posts: 3,745
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.

Last edited by raymor; 07-16-2012 at 05:12 AM..
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-16-2012, 05:15 AM   #8
raymor
Confirmed User
 
Join Date: Oct 2002
Posts: 3,745
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.
__________________
For historical display only. This information is not current:
support@bettercgi.com ICQ 7208627
Strongbox - The next generation in site security
Throttlebox - The next generation in bandwidth control
Clonebox - Backup and disaster recovery on steroids
raymor is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.