Page 1 of 1

Cant open php files on localhost

PostPosted: 06. June 2015 19:28
by Tregeze
Hi
I have installed xampp 5.6.8 and at first apache did not work because of port 80, so i have changed that to 8080. After that apache have started working and i can access localhost, but when I enter localhost:8080 i get this link: http://localhost:8080/xampp/ and i can work on xampp panel. But my problem is that i can not open any php files!
If i enter localhost:8080/xampp/htdocs/index.php i her web page that say:

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.5.24

i have even changed add # ::1 in C:\Windows\system32\drivers\etc\

Can anyone help me with this problem ?

Re: Cant open php files on localhost

PostPosted: 06. June 2015 19:56
by Nobbie
Tregeze wrote:If i enter localhost:8080/xampp/htdocs/index.php i her web page that say:


1. This is a wrong URL, "/xampp/htdocs" is the DocumentRoot in Apache (please read the documentation) and is already part of "localhost". So if you simply enter "http://localhost:8080/index.php" into your browser, Apache executes the file c:/xampp/htdocs/index.php.

If you enter http://localhost:8080/xampp/htdocs/index.php, Apache looks for c:/xampp/htdocs/xampp/htdocs/index.php - which if course does not exist.

2) Did you replace the index.php file in htdocs? Because if you simply enter http://localhost:8080, this already yields to http://localhost:8080/index.php (due to "Directoryindex" setting, again please read Apache documentation) and that is the default behaviour for a fresh Xampp install. In index.php there is a redirect to the xampp Panel (which is located in the xampp subfolder). So why do you try to run http://localhost:8080/index.php? What result do you expect? Give your test file another name (for example test.php) or create a subfolder in htdocs, lets call it "myfolder" and create your own index.php in that folder. You can trigger this file via http://localhost:8080/myfolder/index.php

Finally, i strongly do not recommend to change the default Port 80 to Port 8080. Instead you should find out, which software (mostly either Skype oder Microsoft IIS) already blocks your Port 80 and either stop that program, or configure Skype in the options menu, not to use Port 80. Restart Skype (or whatever it is) and Apache after und reset the Apache Port to 80. Port 80 is the standard Port for HTTP protocoll.

Re: Cant open php files on localhost

PostPosted: 06. June 2015 22:30
by Tregeze
I have followed you advice and now is working. Thank you man for help.

I apologize for now reading documentation. One again thank you :)