Forum Moderators: phranque

Message Too Old, No Replies

trouble getting my website working properly in virtual host

php line not working

         

Bucephalus

1:12 pm on Feb 25, 2010 (gmt 0)

10+ Year Member



Hi

I am running XAMPP, and I followed some instructions on how to get a virtual host running. Here they are:
[foundationphp.com...]

Now, my localhost server works fine with the website working fine, but my front page is missing the horizontal menu when I run it from a virtual host.
Particularly this line doesn't seem to be running out of virtual host. This line new the top of my body doesn't seem to be getting executed

<!--sphider_noindex--><?php require_once('includes/horizmenu.inc.php'); ?><!--/sphider_noindex-->


Once again, it's fine when I run it from the htdocs folder, it just doesn't work when I run it from a virtual host.
Does anyone have any ideas?

David.

jdMorgan

4:37 pm on Feb 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is this the only PHP dependency in your home page? If so, then the problem would seem to be that PHP is unavailable in the vHost context, and you should look to be sure that the PHP configuration is fully-defined for each vHost.

You can discern an execution problem from a PHP invocation problem using "View Page Source" in your browser: If you see the source-code exactly as you posted above, then the problem is that this file is not being parsed for PHP code. If you see anything else, then that would mean that the file is being parsed for PHP, but that there is some problem with the execution of the PHP code.

A check of your server error log might also reveal some useful information.

Unfortunately, that's about all I can offer in this case... You might want to review the PHP set-up tutorials in our PHP Forum Library, and then ask the PHP gurus over there for PHP-specific help.

Jim

Bucephalus

3:21 am on Feb 26, 2010 (gmt 0)

10+ Year Member



Yeah I checked out the things you told me to.
1) The error log gave no clues
2) when I viewed the source in the browser, yes, the php code was exactly the same as the source. ie:
 <!--sphider_noindex--><?php require_once('includes/horizmenu.inc.php'); ?><!--/sphider_noindex--> 



is still there. It seems that there is something wrong with the setup, but I have gone over another tutorial on setting up virtual hosts and it doesn't mention anything about changing any configuration for php.

I will ask the guys over at php forum.
thanks for your response.

David.

Bucephalus

6:33 am on Feb 27, 2010 (gmt 0)

10+ Year Member



Well I finally fixed the problem, but I don't understand why it fixed it. There is a line in the http-vhosts.conf:

#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80


I had this uncommented at first and it didn't seem to affect pages served from the htdocs directory, but when I used a virtual host, this line seemed to cause problems. With it commented out, my virtual host now sees php.

Does anyone know why this is?

Thanks.