Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have been developing websites for quite some time now and recently web applications. I am trying to achieve strong cross-browser coherence with a new site that I am designing so I downloaded the Opera browser.

However, pointing Opera to localhost - which Chrome and Firefox have no troubles with - returns a 404 error. Is there some setting I am missing out? How do I test my site with Opera?

Note: It is a PHP site, not just HTML files; so I have to go through localhost for Apache to recognize and run the PHP files.

EDIT: The URL that raises 404 is a relative path to localhost (e.g. http://localhost/~user/website/

Here is a screenshot of Chrome and Opera 11.11, as seen below no files work on the Opera Browser.

Chrome and Opera 11.11

share|improve this question

migrated from webapps.stackexchange.com Jun 18 '11 at 15:48

This question came from our site for power users of web applications.

    
That last edit changes the entire attack of the question –  random Jun 18 '11 at 18:22
2  
Insufficient information on a lot of stuff, e.g. what's the OS, etc? I agree on "random"'s comment above, too. And that there were 3:rd party software installed (Is "Pow" a necessary, "out-of-the-box" component in all development sites?) should also be included in the original question. –  TFM Jun 21 '11 at 6:30

3 Answers 3

You could try to access the localhost by its IP instead: 127.0.0.1 can't test though, just a guess

The issue with Opera is that it doesn't allow content to be displayed from localhost. You obviously need to add 127.0.0.1 to the list of trusted websites and access it by IP instead.

Another forum thread suggests to check for the "Anonymous access" option in IIS settings, if that's the web server being used.

share|improve this answer
    
going to localhost works fine. I can access localhost through the IP, "localhost" or the computer's domainname. The 404 arises then you try to access a relative path to localhost such as http://localhost/~username/website. Thanks for pointing this out –  Yasky Jun 18 '11 at 17:47
    
@Yasky interesting, I just tried on Opera using Mac's built in web server and was able to navigate to localhost/~username, though I do not have PHP enabled in my config so it just brings up the file. Try updating your question with which server and version of Opera you are using to test, whether it is the PC's built in, or your own Apache rollout –  phwd Jun 18 '11 at 18:35
    
I am runnung Apache on my OS X and the versino of Opera is 11.11. I have also uploaded a picture t.co/74y4Ovq of Chrome and Opera visiting the same page. Apparently the problem exists for all files. What setup do you have for your Apache? –  Yasky Jun 21 '11 at 4:48

Looking at your edit, have you included index.php in your Apache config’s DirectoryIndex statement?


PHP is not a client-side system, it’s a server-side program, so it doesn’t use URI-relative paths, it uses local file-system paths.

In other words, you can’t do things like

include "/common/blah.php"
include "http://localhost/common/blah.php"
etc.

You need to do something like the following instead

include "C:\web\project1\common\blah.php"
include "../../common/blah.php"
etc.

It’s strange that Chrome and Firefox would work; perhaps they have cached the page from some other source.

share|improve this answer
up vote 0 down vote accepted

Problem solved. I had Pow installed and it changed some file in /etc/ on installation. Details, I do not know. But when I uninstalled this, Opera could view the files.

share|improve this answer

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.