I tried to search for a difference but each time the vars are identical, any ideas ?
Asked
Active
Viewed 1.4k times
8
-
1Better answers at https://stackoverflow.com/questions/279966/php-self-vs-path-info-vs-script-name-vs-request-uri – Ian Dunn Jul 14 '16 at 18:30
2 Answers
3
http://www.php.net/manual/en/reserved.variables.server.php
Based on my understanding of this, they can be different if you're executing through the command line (CLI).

AvatarKava
- 15,245
- 2
- 27
- 33
-
-
4@Asaf `SCRIPT_FILENAME` should contain an _absolute_ path, whereas `SCRIPT_NAME` is document root-relative, so they should be different is most web hosting environments, not "identical"? However, they can also refer to different files entirely if using an Apache `Alias`. In this case `SCRIPT_FILENAME` refers to the file being directed to, whereas `SCRIPT_NAME` appears to report the URL/file you are requesting. – MrWhite Jun 08 '15 at 15:16
1
Check THIS Difference:
script_filename returns REAL DIR C:/xampp/htdocs/demo/index.php
file returns LOGIC JUNKTION D:\www\local\demo\cms\init.php
Hold that in mind when checking pathes

Humer IT
- 132
- 3