I have an issue with using the following code in my CakePHP app.
In my development server(@ home):
- When I use
$_SERVER['DOCUMENT_ROOT'], I get:/home/xxxxxxx/public_html/app/webroot/
On my production server (a2hosting), which is an exact duplicate of my application:
- The same code returns
/home/xxxxxx/public_html/
Why is that happening and how can I quickly fix it.
Thanks,
Use the global
WWW_ROOTinstead. It is set by CakePHP.