Dreamhost Moved You to a New Server and Your Site Shows an 'Internal Server Error'
If you had a custom php.ini setup on your website, usingย http://sxi.sabrextreme.com/dh-phpini then this post is to help you fix the Internal Server Error after a Dreamhost server migration and then restore your previous custom php.ini entries.
โโโโโโโโโโโโโโโโโโโโโ
Step 1. Delete these lines from ~/<yourdomain.com>/.htaccess
#--- DH-PHP handlers --- AddHandler fastcgi-script fcg fcgi fpl AddHandler php-fastcgi .php Action php-fastcgi /cgi-bin/dispatch.fcgi
After this your site should work again, without the Internal Server Error, but youโll still need to put your custom php.ini values back in-place with the subsequent steps.
โโโโโโโโโโโโโโโโโโโโโ
Step 2. Set domain to use PHP 5.3 in Dreamhost Control Panel (Manage Domains -> Click โEditโ Under Fully Hosted User For Domain You Want to Update -> Web Options / PHP Mode Select: PHP 5.3.x FastCGI (default) -> Click โChange Settingsโ -> Wait 10 minutes or so before doing step 3)
โโโโโโโโโโโโโโโโโโโโโ
Step 3. Per http://wiki.dreamhost.com/PHP.ini#phprc โIn your userโs home directory /home/<username>/ make a new folder .php. This folder name starts with a โ.โ or dot, and if youโre using an FTP program you may need to turn on โview hidden files and foldersโ to see it after you make it. Inside that make another folder 5.3. The shell command for all that is:โ
mkdir -p ~/.php/5.3
โโโโโโโโโโโโโโโโโโโโโ
Step 4. In ~/.php/5.3/ create a new text file called: phprc
โโโโโโโโโโโโโโโโโโโโโ
Step 5. Put any php.ini custom values in phprc, for example if you wanted to increase your upload filesize limit:
upload_max_filesize = 50M post_max_size = 50M
To note, you should be able to look through your previous custom php.ini values in /home/<username>/<yourdomain.com>/cgi-bin/php.ini
โโโโโโโโโโโโโโโโโโโโโ
Step 6. (optional) Run this terminal command to apply the updates, or optionally just wait 10 minutes or so for the updates to take effect on their own.
killall php53.cgi
โโโโโโโโโโโโโโโโโโโโโ
Step 7. Verify your new settings were applied by viewing the output of the following in a PHP page:
<?php phpinfo(); ?>
โโโโโโโโโโโโโโโโโโโโโ
Hopefully your website is working 100% again at this point.

















