Document Root Question

Jan Wojtasinski

New Member
After migrating my site to KH everything seems to be working fine, with the exception of applications that rely on $_SERVER['DOCUMENT_ROOT']. After tracking down the code it looks like the variable is pointing to the apache/HTDOCS folder instead of the public_html folder in the users home. Any suggestions on how to fix this? I noticed in my httpd.conf that the virtualhost for the site is declared multiple times, once with the actual path and once with the apache/htdocs path. Is it as simple as editing one of the includes files to point that domain to the correct document root?

Thanks,

Jan
 

KH-Jonathan

CTO
Staff member
Jan,

Glad to hear your migration went pretty smoothly! The first thing that comes to my mind regarding this issue is file ownership: who owns the file, the user, nobody, or root?

If it's root or nobody I bet that's what's causing your issue.
 

Jan Wojtasinski

New Member
Thanks for the reply Jonathan,

The owner of the file and the folder are both the user. I don't believe it matters but: File permissions are 644 folder permissions are 755.
 

Dan

Moderator
Hi Jan,

Are you accessing your site using the IP/~username? This post on the cPanel forums that says it works fine if you access it using the domain name.
 
Top