| PHP, MySQL General PHP questions. Or go to our PHPsuexec Forum >> |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread |
|
|
#1 (permalink) |
|
Registered User
Seasoned Poster
Joined in May 2003
Lives in Atlanta, GA
69 posts
Gave thanks: 0
Thanked 1 Time in 1 Post
|
I'm getting this error:
"Allowed memory size of XXXX bytes exhausted (tried to allocate 4000 bytes)" I'm on a shared hosting server - so I don't have direct access to php.ini. I tried the .htaccess method: php_value memory_limit 32000000 which gave me a Server Error 500... I also tried init_set() from the PHP file at the top: ini_set(”memory_limit”,”32M”); Which seemed to make no difference (same error) How do I get around this memory issue?
__________________
Server: simplemedia.com XX.XX.74.115 (Reseller) DNS: ns770.dizinc.com ns771.dizinc.com Sites: www.simplemedia.com www.southernbloom.com www.torimoto.net www.rubyforest.net |
|
|
|
|
|
#2 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,219 posts
Gave thanks: 18
Thanked 86 times
|
If PHP is configured correctly, you can use a local PHP.INI file to over-ride values. Just create in the directory where the script is:
Code:
[php] memory_limit = 64M ; Maximum amount of memory a script may consume (8MB)
__________________
|
|
|
|
|
|
#3 (permalink) |
|
Registered User
Comfy Contributor
Joined in Jan 2006
Lives in Mississippi
Hosted on SH142
104 posts
Gave thanks: 12
Thanked 4 times
|
Grab this file:
http://surmunity.com/images/thephp5!/php.ini and put it into the directory where your php script is. Read here if you like.
__________________
LanceDean.com |
|
|
|
| This user thanks snakeyez.us for this great post! | Lifestar (July 6th, 2008) |
|
|
#4 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Jan 2006
3 posts
Gave thanks: 1
Thanked 0 times
|
Son of a *%^$#. I have been having tons of problems with my sites the last few days login in as admin getting all sorts of errors. I started messing with stuff to the point it was completely broke. Decided to blow my Gallery away and re-install and still had weird problems. put that php.ini file in and things worked. Would have been nice if Surpass would have let us know this instead of sending an email saying everything will be fine after their upgrade.
|
|
|
|
|
|
#5 (permalink) | |
|
Registered User
Seasoned Poster
Joined in May 2003
Lives in Atlanta, GA
69 posts
Gave thanks: 0
Thanked 1 Time in 1 Post
|
Quote:
Also - This only seems to work with the PHP files in that directory, but not subdirectories? Is this correct? Also also (wic wic) - Any suggested methods to figure out how much memory a PHP script is using up?
__________________
Server: simplemedia.com XX.XX.74.115 (Reseller) DNS: ns770.dizinc.com ns771.dizinc.com Sites: www.simplemedia.com www.southernbloom.com www.torimoto.net www.rubyforest.net |
|
|
|
|
|
|
#6 (permalink) |
|
Race Surpass
Super #1
Joined in Jul 2006
Lives in Oklahoma City, OK
Hosted on sh102
1,219 posts
Gave thanks: 18
Thanked 86 times
|
Check this out: PHP: memory_get_usage - Manual
I haven't tried using it. Not sure if it's a server-wide setting or a per account setting, but the PHP.INI file in my public_html directory affects all the php scripts in that folder and below. My add-on and sub-domains have their own PHP.INI files in their root-folders.
__________________
|
|
|
|