PHP.ini
From DreamHost
| The instructions provided in this article or section are considered advanced. You are expected to be knowledgeable in the UNIX shell. |
Below are instructions for using your own modified version of php.ini on a domain called "example.com". DreamHost technical support does not recommend, and will provide no support for this method. Follow these instructions at your own risk.
Contents |
Create a cgi-bin folder for your domain
mkdir $HOME/example.com/cgi-bin
Copy the default php.ini file
cp /etc/php5/php.ini $HOME/example.com/cgi-bin/php.ini
Make modifications to this file as necessary. Note that some variables (in particular, post_max_size and upload_max_filesize) are subject to internal limitations; increasing them significantly beyond the default values will not work correctly.
Create the script wrapper
cat << EOF > $HOME/example.com/cgi-bin/php-wrapper.cgi #!/bin/sh exec /dh/cgi-system/php5.cgi $* EOF
Set permissions
chmod 755 $HOME/example.com/cgi-bin chmod 755 $HOME/example.com/cgi-bin/php-wrapper.cgi chmod 640 $HOME/example.com/cgi-bin/php.ini
Set up the .htaccess file
The .htaccess file is located in your document root at $HOME/example.com/.htaccess.
Add this to run .php files with your custom PHP wrapper:
Action php-cgi /cgi-bin/php-wrapper.cgi Action php5-cgi /cgi-bin/php-wrapper.cgi
You can now modify $HOME/example.com/cgi-bin/php.ini to your heart's content!

