Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Iam running Zend with Apache and got to see a strange behaviour....

If i type http://127.0.0.1 in my browser url, it works fine, but after typing: http://localhost, i will get a file download window, saying file type as: application/x-httpd-php

And in my httpd.conf file, i have the following under VirtualHost *:80 definition:

ServerName localhost

DocumentRoot E:\zend\Apache2\htdocs\my_project\public

Directory E:\zend\Apache2\htdocs\my_project\public

Perhaps some configuration problem... can anyone guide me..

share|improve this question

migrated from stackoverflow.com Feb 5 '11 at 11:27

This question came from our site for professional and enthusiast programmers.

    
What is the content of this file if has content? Is it a php script? –  greg0ire Feb 5 '11 at 11:23
    
It is not a php file, its name is something random string, like: FYJqRx7z.part, and its an empty file –  shasi kanth Feb 5 '11 at 11:37
    
Attach httpd.conf. All path enclose in double quotes. –  alvosu Feb 5 '11 at 11:49
    
sorry i cannot attach the httpd.conf file... but can anyone tell me a reason for this? –  shasi kanth Feb 5 '11 at 11:56
    
I pinged for> ping:localhost, it is fine, and pinging> ping:127.0.0.1 also is fine... –  shasi kanth Feb 5 '11 at 12:57

2 Answers 2

up vote 3 down vote accepted

from the httpd.conf file:

NOTE: Where filenames are specified, you must use forward slashes instead of backslashes (e.g., "c:/apache" instead of "c:\apache"). If a drive letter is omitted, the drive on which Apache.exe is located will be used by default. It is recommended that you always supply an explicit drive letter in absolute paths to avoid confusion.

so change the

DocumentRoot E:\zend\Apache2\htdocs\my_project\public

to

DocumentRoot "e:/zend/Apache2/htdocs/my_project/public"

the Directory E:\zend\Apache2\htdocs\my_project\public is the part of the config file in which services and features are allowed and/or disabled in that directory, so it has to go like this:

<Directory "e:/zend/Apache2/htdocs/my_project/public"> some options </Directory>

it would be easier to point out what's wrong if you would post the httpd.conf here, or upload it somewhere and post a link to that file

share|improve this answer
    
This doesn't explain why localhost doesn't work though –  Mark Henderson Feb 5 '11 at 19:48
    
getting an application/x-httpd-php file download window is a weird error, I'm doing my best here with the things dskanth submitted –  addam Feb 5 '11 at 19:53
    
Thanks for the answers... i got my problem solved now... i have restarted the zend server after making the change in DocumentRoot statement, as addam pointed, and localhost works now :) –  shasi kanth Feb 8 '11 at 5:29

Check your hosts file, typically in someplace like:

C:\windows\system32\drivers\etc

Make sure that there is an entry for localhost like this:

127.0.0.1 localhost

Frankly, I can't immediately see why the absence of such an entry would produce the result you report - a download of type application/x-httpd-php - but when something's not working, always best to dot all the i's and cross all the t's. ;-)

share|improve this answer
    
Yes, indeed that entry is present in my hosts file. –  shasi kanth Feb 8 '11 at 5:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.