DreamHost PHP5 Error in Unix Shell

by Andrew on May 21, 2010

in Maintenance,MediaWiki

I’m in the process of *finally* moving the wiki from Network Solutions to Dreamhost. Along the way, I encountered an unusual error while updating from MW 1.13.1 to 1.15.3 (yeah, so we were a little outdated but whatever):

In my UNIX shell I typed in the following to run the update.php script:

php update.php

only to get this error:

Sorry! This version of MediaWiki requires PHP 5; you are running 4.9.2. If you are sure you already have PHP 5 installed, it may be installed in a different path from PHP 4. Check with your system administrator.

So I verified that DreamHost servers run PHP5 and Googled around a bit more. A similar thread in the DH forums surfaced after a LOT of searching and within it I found a solution that worked. From the command line, type:

/dh/cgi-system/php5.cgi update.php

to invoke PHP5 instead of PHP4. Apparently command line scripts run in PHP4 by default but browser calls are executed with PHP5. Interesting, hope it helps.

The full migration will be completed soon. A few extensions are giving me trouble, then I have to migrate the blog and Piwik. The good news is that the DreamHost servers are working about 4X faster than the old Network Solutions servers. Sweet!

Possibly Related Posts:

  1. Request: XML Sitemap Generator
  2. How to Speed Up MediaWiki for SEO

Leave a Comment

Previous post:

Next post: