Apache - PHP (Subdirectories)

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Hermit TL
Forum Commoner
Posts: 69
Joined: Mon Nov 21, 2011 12:16 am

Apache - PHP (Subdirectories)

Post 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.)
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Apache - PHP (Subdirectories)

Post 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?
Hermit TL
Forum Commoner
Posts: 69
Joined: Mon Nov 21, 2011 12:16 am

Re: Apache - PHP (Subdirectories)

Post 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.)
Post Reply