WordPress.org

Ready to get started?Download WordPress

Forums

Php-cgi vs Php as an Apache module (3 posts)

  1. michaelndn
    Member
    Posted 9 years ago #

    Php-cgi is useful in that it allows you to run php as specific user instead of as the user apache runs as, but php doesn't present exactly the same enviornment to the php programmer when running under the different modes. One example is documented here [http://wiki.dreamhost.com/index.php/WordPress]

    "Certain plugins make use of environment variables that are not present on DreamHost's servers. If you run into weird problems, try adding this to your wp-config.php on the line after the initial "<?php":

    $_SERVER['SCRIPT_NAME'] = $_SERVER['SCRIPT_URL'];
    $_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'].$_SERVER['SCRIPT_URL'];

    Since $_SERVER['SCRIPT_NAME'] variable will
    return the php.cgi binary rather than the name of your script, WP 1.5.1 with multiple front page index will not work in a php-cgi enviornment. Is there an easy way to make WordPress enviornment neutral in this regard? Thanks!

  2. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    The use of SCRIPT_NAME in 1.5.1 was a mistake. It'll be gone in 1.5.1.1.

  3. varunkrish
    Member
    Posted 8 years ago #

    pl check this thread for the diff between php as apache module and cgi binary

    http://varunkrish.com/php-as-apache-module-vs-php-as-cgi-binary.html

Topic Closed

This topic has been closed to new replies.

About this Topic