Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 12:03:40 PM

Pages: [1]   Go Down
  Print  
Author Topic: php memory quota  (Read 7113 times)
vv
Trekkie
**
Offline Offline

Posts: 14


« on: July 29, 2011, 02:56:25 PM »

A page on one of our sites uses a google map where we plot cities where our users are. Unfortunately (or luckily?), we came to a point when the script that plots the data is exceeding php's default mem quota. The URL of that page is http://daihinia.com/map/deployments

Can we increase the php mem quota for a specific site? If yes, how?
Logged
MichaelT
Support
Jabba the Hutt
*****
Offline Offline

Posts: 529



« Reply #1 on: July 30, 2011, 03:40:37 AM »

Hi,

You can increase the site's memory allowance through the use of a custom php.ini page. You can see some more on doing that here; http://wiki.lunarpages.com/Create_php.ini and for the php.ini entries you will want to use something like the following;

max_execution_time = 60
memory_limit = 60M
Logged

vv
Trekkie
**
Offline Offline

Posts: 14


« Reply #2 on: July 30, 2011, 05:02:29 AM »

as far as i understand, the site's php.ini should contain only the necessary settings, leaving the rest to the server's default?
Logged
vv
Trekkie
**
Offline Offline

Posts: 14


« Reply #3 on: July 30, 2011, 05:52:51 AM »

also... wouldn't this suffice, in .htaccess?
php_value memory_limit 60M
Logged
MrPhil
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 5215



« Reply #4 on: July 30, 2011, 06:02:29 AM »

also... wouldn't this suffice, in .htaccess?
php_value memory_limit 60M
No. .htaccess does not allow php_value and php_flag. You will get a "500" error. Use php.ini instead.

Quote
as far as i understand, the site's php.ini should contain only the necessary settings, leaving the rest to the server's default?
Correct. Run
Code:
<?php phpinfo(); ?>
to see what the default settings are, and what you need to override.
Logged

Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-
vv
Trekkie
**
Offline Offline

Posts: 14


« Reply #5 on: July 30, 2011, 07:12:05 AM »

just dd as MichaelT suggested, as per the link he provided.
my custom php.ini contains just this:
[PHP]
memory_limit = 128M      ; Maximum amount of memory a script may consume

i keep getting "user warning: Got a packet bigger than 'max_allowed_packet' bytes" on that page. other pages seem to work fine.
what else should i add to my php.ini?
Logged
Jawadt
Space Explorer
***
Offline Offline

Posts: 8


« Reply #6 on: July 30, 2011, 12:00:17 PM »

Hello,

max_allowed_packet is not a PHP variable but a MySQL variable which needs to be updated in the MySQL configuration file. It might not be possible to tweak it on a shared environment but can be easily updated in a VPS or dedicated environment. Please update your ticket for any questions in this regard.

just dd as MichaelT suggested, as per the link he provided.
my custom php.ini contains just this:
[PHP]
memory_limit = 128M      ; Maximum amount of memory a script may consume

i keep getting "user warning: Got a packet bigger than 'max_allowed_packet' bytes" on that page. other pages seem to work fine.
what else should i add to my php.ini?
Logged
vv
Trekkie
**
Offline Offline

Posts: 14


« Reply #7 on: July 30, 2011, 12:58:44 PM »

Obviously, this problem appeared after i've overriden php.ini, without touching any of mysql configs (which i don't have access to).

It seems that there are some options in the hoster's php.ini that got replaced, even if i didn't specify anything mysql-related in my php.ini.

Very strange.
Logged
vv
Trekkie
**
Offline Offline

Posts: 14


« Reply #8 on: July 30, 2011, 04:18:12 PM »

The problem disappeared without any action on my side. Probably the admin changed there something at the same time with me.
Logged
vv
Trekkie
**
Offline Offline

Posts: 14


« Reply #9 on: July 30, 2011, 04:32:17 PM »

Now it's back again. Sad
Logged
MichaelT
Support
Jabba the Hutt
*****
Offline Offline

Posts: 529



« Reply #10 on: July 31, 2011, 01:42:10 AM »

Now it's back again. Sad
I checked your account and do not see any entries in your .htaccess needed to activate your custom php.ini file in the public_html/daihinia subdirectory.
Logged

vv
Trekkie
**
Offline Offline

Posts: 14


« Reply #11 on: July 31, 2011, 01:33:57 PM »

look at the very bottom, there's suPHP_ConfigPath there.
and i can confirm it's active, given that i get no more quota exeeded's.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: