Forum Moderators: coopster
I am redoing my php installation from scratch. One thing that has always perplexed me about the php install process is this line in the ini:
> doc_root = "C:\Program Files\Apache Group\Apache2\htdocs"
I use virtual hosts under Windows/Apache, so there is no single doc_root (about 200 of them on my system).
; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues. The alternate is to use the
; cgi.force_redirect configuration below
What should I put in there - just root "/" because most of the virtual "root" directories are pointed off root somewhere. eg: "c:/home/www/searchengineworld/..." or "c:/usr/www/sites/webmasterworld/")?
What are the security implications?
<VirtualHost 127.0.0.11>
DocumentRoot g:/htdocs/somesite/html
ServerName somesite
</VirtualHost>
I don't think I've ever touched that setting in php.ini either. It makes sense that it woudl only kick in if no valid value is being set for that host in the httpd.conf, which I guess woudl be the case with the CGI version.
BTW - recently had to wipe my laptop hard drive and decided to try xampp as someone suggested in the original version of this thread. What a great way to get everything up and running in one go.
You can set the PHP script document root by the configuration directive doc_root [php.net] in the configuration file, or you can set the environment variable PHP_DOCUMENT_ROOT. If it is set, the CGI version of PHP will always construct the file name to open with this doc_root and the path information in the request, so you can be sure no script is executed outside this directory (except for user_dir below).
[php.net...]