Web server using forward slashes
I have a web server set up using XAMPP's php.exe as the interpreter. My implementation relies on forward slashes in the document root to set a global variable. However, phpinfo() shows the document root with back slashes. I tried changing the slashes in the "Document root" field in my run configuration but it does not affect anything.


Any help here would be appreciated. Thank you.
Please sign in to leave a comment.
Hi there,
1.
PHP shows (and uses) whatever the native path for that OS is (Windows in your case).
You would need to change the code a bit to be platform independent here (e.g. use DIRECTORY_SEPARATOR constant when you manipulate the paths).
2. Side note.
You are using PHP's built-in web server. Why not use full Apache from XAMPP if you have it installed already (virtual host with some fake local domain name via hosts file)? Apache will always be better as it supports .htaccess and other stuff + it's more close to production environment.