Hello,
I'm running Drupal 6.15 with MAMP 1.8.4 (NOT MAMP PRO). I set a virtual host to point to a directory completed unrelated to /Applications/MAMP/htdocs:
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
ServerName testsite
ServerAlias testsite.local
DocumentRoot /Users/jonlee/Desktop/testsite
ErrorLog /Applications/MAMP/logs/ordoe_error_log
LogLevel debug
<Directory /Users/jonlee/Desktop/testsite>
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Whenever I try to load any PHP page under the virtual host name I get "You have chosen to open .... as an PHP file" or sometimes as a "application/x-httpd-php" file. The funny thing is if I try to run the default http://localhost:8888/MAMP/index.php it runs fine.
I changed my httpd.conf file to output server-info, and under localhost it loads mod_php5.c just fine. I can't do that with my virtual host.
I even tried to change my localhost's DocumentRoot to point to the virtual host's root (and I also changed the directive also), and I get the same error. So it must not be the VirtualHost directive, but something else.
Does anyone know why the PHP handler won't get run under the virtual host, or under the localhost for that matter? Is it something that's only available in the MAMP PRO version that's not allowed in the normal MAMP? Or do I need to adjust the .htaccess file? It's just odd that the default website that comes with MAMP runs fine, but the Drupal site does not.
Comments
Oops-- just to clarify, in
Oops-- just to clarify, in the code I show the virtual host port to be 80, but in my post I say 8888. I didn't want to confuse too many issues, but currently, I reset the Listen port to 80 in the httpd.conf file. So I'm loading these sites on my firefox browser via http://localhost/... and http://testsite/..., with testsite mapped to 127.0.0.1 in my /etc/hosts file.
Two apaches?
I'd be looking closely to see whether the web server I'm talking to is the one I think I'm talking to. I don't have my Mac handy atm, but I'm sure it already has a webserver installed and ready to share your files.
Your configuring one server and talking to the other would fully explain your problem;-)
Check to see how many webservers are actually running. The lsof command is my usual too;
lsof -i -n | less
You will need to be root.
what should i be looking for
what should i be looking for from the output?
and do you know if there's a difference in configuration between leopard and snow leopard? i recently upgraded my laptop to snow leopard--i wonder if that caused something also.