I recently needed to increase the memory_limit
, upload_max_filesize
and post_max_size
values to something higher than the measly amount set by a particular webhost's default php.ini file. This account had cPanel on it and overriding the php.ini defaults the usual way (by adding various lines to the .htaccess or settings.php files) didn't work at all. If you've had the same experience, you may find that this how-to works for you.
This how-to is for any version of Drupal running on Linux and Apache. No Drupal modules are needed, but the devel module certainly helps.
1. Get and modify your custom php.ini file
It's best to use a php.ini file that somewhat resembles the one already running on your server. You can probably find one at /usr/local/lib/php.ini
or /usr/local/Zend/etc/php.ini
and just copy it into your account's web folder (it may be called "public_html" or "www" or "htdocs" or something -- you know the one).
2. Creating your CGI script
Now create a small script and put it in your cgi-bin directory. In your web folder, create another folder called "cgi-bin" if it's not there already. Using your preferred text editor, create a file name "php.cgi" and put the following into it: