Skip to content
Advertisement

Apache Virtual Host not parsing PHP

I decided to enable virtual hosts on my Apache server, and chose to make it port-based.

First thing I did, of course, was RTM. I followed the instructions found here. Well, it worked — kind of. As far as the virtual host running, it does. The content pulled from :80 is different from :8080.

But PHP isn’t working. The “original site”, (port 80) is running PHP just great. The port 8080 site, however, sends the PHP to the browser. I see nothing in the browser, but the source code shows:

JavaScript

This topic seems to be very loosely documented on a few websites, but either I can’t find a solution in them, or the solution listed isn’t working for me.

Again, the virtual host itself is running fine. PHP, on the other hand, is not.

Any ideas on what it could be? What content from my httpd.conf file should I provide so I don’t blow up my question by copy/pasting the whole thing?

(Sorry I forgot to post that I had these in place, Phil. Adding to avoid further confusion)

JavaScript

I tried adding this inside the tags:

JavaScript

…but to no avail.

Advertisement

Answer

This finally put me on the right path:

http://www.linuxquestions.org/questions/linux-server-73/php-not-working-on-one-vhost-but-works-on-all-others-851093/

Here’s the solution:

In the <Directory> section, I included these lines:

JavaScript

Or, a redacted copy/paste of the solution on my server:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement