Page 1 of 1

Apache - PHP (Subdirectories)

Posted: Fri Nov 25, 2011 8:46 pm
by Hermit TL
I'm running Apache2 on Ubuntu as my development area, I started organizing my files and noticed that PHP only works in the root directory (/var/www) so say I put a file called function.php in say '/var/www/function' and refer to it in an include in /var/www/index.php the index.php script will run but the function.php will not.
I'm betting there is something wrong with either the configuration of PHP or maybe Apache but I have no idea where to start looking to fix the problem. (Google hasn't me on this one.)

Re: Apache - PHP (Subdirectories)

Posted: Fri Nov 25, 2011 9:33 pm
by Celauran
The Ubuntu LAMP stack has always worked right out of the box for me. Have you tried a phpinfo() file in one of the directories that isn't working? Does anything display if you access it directly?

Re: Apache - PHP (Subdirectories)

Posted: Fri Nov 25, 2011 9:51 pm
by Hermit TL
The Ubuntu LAMP stack has always worked right out of the box for me.
Me too, first time I've ever had a problem with it.
Have you tried a phpinfo() file in one of the directories that isn't working?
Yup, nothing. It doesn't work.

I just purged the whole LAMP stack and reinstalled it and it seems to be working fine now. (For anyone else reading this, that is the worst solution.)