$_SERVER['REQUEST_URI'] returns full URL instead of path to script

前端 未结 3 1065
死守一世寂寞
死守一世寂寞 2021-01-22 12:52

My PHP app is not working because of $_SERVER[\'REQUEST_URI\'] returns the full url to the script instead of a relative path.

My environment:
Wind

3条回答
  •  再見小時候
    2021-01-22 13:28

    I finally got it working.
    Here is the steps i did ( i don't know why it is effected, but it is working now ).

    1. Install PHP Fastcgi on xampp, i follow this steps: https://commaster.net/content/installing-php-fastcgi-and-zend-opcache-xampp-windows
    2. I load the mod_fcgid, but i don't use php-cgi.exe handler
    3. Update my /etc/hosts file and flush dns with this command ipconfig /flushdns
    4. Restart apache

    And it is working somehow.
    Honestly i don't know why it is working, but if someone stumble the same problem, i hope the solution might help.

提交回复
热议问题