SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru DenverDave's Avatar
    Join Date
    Feb 2001
    Location
    Denver, Colorado
    Posts
    630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure that this must have been discussed a thousand times, but what is the story with $PHP_SELF not working "properly" under windows. As I understand it we have to override with $PHP_SELF = $PATH_INFO; for $PHP_SELF to have the correct value on each page or include file for each page.

    Parden me, but if this must be done every time for windows, why is $PHP_SELF not set to $PATH_INFO by PHP?

    Just curious - Love PHP4, but seems strange to me.

    Dave

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The reason for this is because you are running php in CGI mode and it has nothing to do with it being on windows. If you run a script on unix through the php interpreter or in CGI mode, the path to the interprter becomes $PHP_SELF just like Windows. If you use PHP as a server module (ISAPI or Apache) on Windows you won't have that problem. If you would like to install php as a module for Apache on windows I suggest reading this link
    http://shanx.com/php/install_win32.txt


    Also most of the bundles you can download normally install it as CGI on Windows, in order to make it work as an apache module you will need to chage the configuration in your httpd.conf file for Apache. Or use IIS and use the ISAPI module. For instructions on that see.

    http://www.php.net/manual/en/install.iis.php


    Or a bit of a hack but you could do this create a file named header.php in it put this

    PHP Code:
    <?
    $PHP_SELF 
    $PATH_INFO;
    ?>
    Now in your php.ini file change the auto_prepend_file directive to match the location of this newly created document header.php. somethiong like this:

    auto_prepend_file = C:\wwwroot\header.php
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •