Support » Fixing WordPress » Dreamhost: Run PHP as CGI? or PHP Version 5?

  • I’m running into a bunch of problems (posts_nav_link not showing up, login errors, etc.) on my Dreamhost account. I read in a thread somewhere that there could be some issues regarding how information is being managed in regards to PHP and CGI.

    Right now, I’m using the default setting, which is PHP as CGI.

    Is this really the best setting for WP?

Viewing 5 replies - 1 through 5 (of 5 total)
  • run PHP as CGI, the newer version of PHP doesn’t add anything you need, whereas if you don’t run PHP as CGI then some things get messed up for WordPress

    I ran the test just to see what would happen, and you’re right, all sorts of messed up!

    But it’s still good to know what’s recommend. Thank you!

    Moderator James Huff


    Volunteer Moderator 🚀

    Just to clarify, WordPress can be run on either PHP as CGI or PHP as an Apache module (PHP 5, in this case). PHP as an Apache module opens up the most features and expansion possibilities, but PHP as CGI offers more security. In this scenario, DreamHost runs PHP 4 as CGI and PHP 5 as an Apache module. However, in order to make running PHP 5 as secure as running PHP 4 as CGI, DreamHost has disabled quite a few features. This will cause your blog to break if it is run under a PHP as Apache module configuration via DreamHost. If you are a DreamHost customer, run your PHP as CGI.

    Ooh, this sucks. I was trying to use the Text Control plugin for all my blogs. I have one blog with Dreamhost that is quite old and never ran with PHP as CGI and so it works fine, as does Text Control. I cannot get Text Control to work on my new blogs, so I changed them to not run as CGI and now everything is broken – error message:
    Warning: main(/home/.elfa/mahalie/ failed to open stream: Permission denied in /home/.elfa/mahalie/ on line 12

    Fatal error: main(): Failed opening required '/home/.elfa/mahalie/' (include_path='.:/usr/local/lib/php') in /home/.elfa/mahalie/ on line 12

    I wonder if Dreamhost automatically re-CHMODs all site directories. I’ve had CHMOD related nighmares before so I’m not going to mess with it. No Text Control for me, I guess.

    UPDATE: I’ve managed to get everything working on Dreamhost without running PHP as CGI. (That is, everything WP-related that I use).

    Dreamhost auto-CHMODs your domain to protect it when you turn off PHP as CGI. Initially, to test it really quick I changed the whole dern site to 777 (not recommended) just long enough to test the site, update permalinks and activate Text Control. It all worked. So, I re-CHMOD all the files to 644 and all the folders to 755. Exceptions are .htaccess, sitemap.xml and sitemap.xml.gz – which changed to 666. (Sitemap files for the Google Sitemap plugin). I got nervous about the .htaccess and changed it back to 644 after the permalinks updated.

    General FYI, this info would have really helped me!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dreamhost: Run PHP as CGI? or PHP Version 5?’ is closed to new replies.