'require' statement path problem

I have 2 working projects on the same server - in 2 folders of the same account. Both projects have “require common.php” for common code to their projects. No problems.

Now, some new functions are common to both projects. So I put them in a folder called “/sys” and in a file called “abc.php”. But when I tried to add “require /sys/abc.php”, php complained that the path /sys doesn’t exist. It does. But when I changed it to “require …/…/sys/abc.php”, it worked ok. That sucks because I can’t always know the relative path - and I shouldn’t have to, even according to php documentation.

I’m using a hosting company, not my own server; could it be their limitation? Any help is much appreciated.

Sponsor our Newsletter | Privacy Policy | Terms of Service