PDA

View Full Version : Php.ini Memory Limit Parameter?



colya@mac.com
07-07-2005, 10:23 PM
I am in the process of installing Gallery2 on my domain.

One of the "system checks" gives me the following error:

Warning: Your PHP is configured to limit the memory to 8Mb (memory_limit parameter in php.ini). You should raise this limit to at least 16Mb for proper Gallery operation.


Is this something changable?

pjk
07-14-2005, 09:30 AM
this taken from some site off the internet:

<begin snippet>

If your web server runs Apache, there are two ways to run PHP through the server. As a module (mod_php), or as a CGI standalone. I will not get into the differences here, but suffice to say that if PHP is running as a module, this solution will work.

You can tell how your server is running PHP by creating a script with the following line: <?php phpinfo(); ?> Upload the file to your server and run it. The third line down should be “Server API". If it says “mod_php", PHP is running as a module. If that line says “CGI", PHP is running as a CGI standalone)

PHP settings can be configured via an .htaccess file, simply by adding a line in the following format: “php_value setting value". For example, one of the lines I was using was “php_value upload_max_filesize 20M".

<end snippet>

Seems to be a solution. I haven't worked with .htaccess yet, will be shortly me thinks.

Also it stated that if PHP is running as a CGI standalone, then you could put a php.ini file in the directory that the script is being called from. This seems precarious, as you could change some things that you don't want, and foobar things up. It does state, though, that it would only change things for the one instance of the executing script, as CGI PHP starts a new instance of PHP for each script execution.

hth

dbmasters
07-14-2005, 04:46 PM
As I recall, the user has no control over this, you could submit a ticket and request the limit be updated on your server...can't promise they'll do it, but if you don't ask they never will :)

scottnj
07-14-2005, 10:49 PM
Adding that setting into your .htacces file should work. There is also one for max post size. I think the max size you can set for each of these is 32M.

peter_n
01-31-2006, 06:35 PM
Just for anyone's future reference, I was able to add this in my site/default/settings.php file in drupal to get it working:

ini_set('memory_limit', '16M');