Forum Moderators: phranque

Message Too Old, No Replies

php and virtualhost problem

Can't execute php scripts from virtual host

         

jfrankman

11:31 pm on Jan 6, 2005 (gmt 0)

10+ Year Member



I am new to apache, so bear with me. I have configured Apache server to run PHP 5 in CGI mode. Its seems to be working fine if you access it using the default ServerName:

[localhost...]

But I cannot get PHP to run in a virtual host I have set up:

[fbsxiptest...]

The virtualhost (fbsxiptest) can display text/html, but I get a 404 error if I access any php file.

OS: Windows 2000
PHP version: PHP5
Apache version: 1.3.3.1

Here is the Virtual host entry from my config file:

<VirtualHost *:80>
ServerName fbsxiptest
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/examples"
<Directory "C:/php-5.0.0RC3-Win32">
AllowOverride None
Options None
</Directory>
<Directory "C:/Program Files/Apache Group/Apache/htdocs/examples">
Options Indexes FollowSymlinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

ScriptAlias /php/ "C:/php-5.0.0RC3-Win32/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"
ErrorLog logs/fbsxiptest-error_log
CustomLog logs/fbsxiptest-access_log common
</VirtualHost>

coopster

11:55 am on Jan 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, jfrankman.

Are you sure you have the correct directories here?

ScriptAlias /php/ "C:/php-5.0.0RC3-Win32/" 
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php-cgi.exe"

jfrankman

2:40 pm on Jan 7, 2005 (gmt 0)

10+ Year Member



Yes, these entries were correct. Thank you for responding. I actually found the problem late yesterday. I had the 'doc_root' explicitly set to point to my one Apache directory in my PHP.ini:

doc_root = C:\Program Files\Apache Group\Apache\htdocs

Once I set this value to blank, all virtual hosts began to work properly:

doc_root =