Sorry for the rather confusing title, I am trying to understand this error.
I have a php file, inside a folder like site.com/src/app/index.php
and this site.com
folder is placed in /var/www/html/
in a CentOs 6.5 running Nginx, and PHP-FPM.
So, the problem is that whenever I use any of the path functions and constants like __DIR__
, getcwd()
, realpath()
inside index.php
I would expect the full path to be as
/var/www/html/site.com/src/app/
but, only site.com/src/app/
gets returned. It is as if, that php/nginx does not know about var/www/html/
folder.
I event went to the app/
dir and was able to get the full path using sudo pwd
but for some reason, php is not reading it.
I would like to know why this is happening, and how to fix it?