Inconsistent results from bulit-in function $_SERVER

murugappan

New member
Hi,
I am not sure if anyone has raised this before but i posting it to get some answers. There seems to inconsistency in results being generated by PHP functions $_SERVER. If run the script using built in php serve] using "php -S localhost:3000" i get "/" for $_SERVER[REQUEST_URi] whereas I get "myroot/php/test-app/" when i use XAMPP. Why is this happening? How do i overcome this? :eek:

I am using PHP 8.1.12 , Windows 10. Please help.
 
It depends on http server, the $_SERVER may be different on built in http server, on apache or nginx, because each of them uses different api (builtin, apache-php or php-fpm).
 
Back
Top