Solved

How to see .php in browser?

Posted on 2013-06-20
15
496 Views
Last Modified: 2013-06-20
Hello all.

Once i could right click and run in chrome with all my .php files. That was how i tested my website.

Now i cant :S I just cant anymore. It only shows me text.


What should i do? I just wanna see my .php file being executed as a webpage and not text.
0
Comment
Question by:Mike Kristensen
15 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39262368
Please post a link to the URL that illustrates the problem, thanks.
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 355 total points
ID: 39262371
PHP has to be parsed through a server, you cannot just load it directly in a browser. So maybe you had some plugin installed that loaded it through localhost instead of directly.
0
 

Author Comment

by:Mike Kristensen
ID: 39262380
Plugin? Where should that plugin be?

So how to parsed it through a server? Do i have to install anything?
0
 

Author Comment

by:Mike Kristensen
ID: 39262395
I used to just write all my code in notepad++ and then upload it. Its hard to understand that i suddenly have to install something, when this simple solution have served me for 8 years or 3 homepages.
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 355 total points
ID: 39262397
I don't know - I've never come across anything like that.
You need either IIS (Windows) with the php extension or something like XAMPP (Apache)
Then you can execute php through http://localhost/page.php

HTML can be displayed directly in a browser because it has no server side scripting.
You're changing the question now, you said you loaded the file directly in a browser, now you are talking about uploading the file somewhere...?
0
 
LVL 22

Assisted Solution

by:plusone3055
plusone3055 earned 60 total points
ID: 39262427
0
 

Author Comment

by:Mike Kristensen
ID: 39262442
I loaded file into browser, in test's... After that i uploaded my website.


I installed XAMPP, and trying to launch Apache now. But it is shutting down, telling me some port is blocked.. SIGH.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 58

Accepted Solution

by:
Gary earned 355 total points
ID: 39262449
Are you sure you don't already have IIS installed? If you are using Skype that will also take over port 80 - which you have to change.
0
 

Author Comment

by:Mike Kristensen
ID: 39262476
I dont know. IIS? Can IIS execute .php correctly?

How to change port 80 in skype?
0
 
LVL 15

Assisted Solution

by:Jagadishwor Dulal
Jagadishwor Dulal earned 85 total points
ID: 39262485
There is xampp-portcheck.exe you can see which servic is using the port 80 or you can configure port in php.ini file.
0
 
LVL 58

Assisted Solution

by:Gary
Gary earned 355 total points
ID: 39262500
0
 

Author Comment

by:Mike Kristensen
ID: 39262505
"Advanced in skype" uncheck "use port 80" close skype.

Start Apache and now it works. Skype aswell using some port 40427.



Thx you all, you made my day, very fast....
I will help all i know, with this problem....


For you to know, my project right now is to make my website into a theme in wordpress. :)
0
 

Author Comment

by:Mike Kristensen
ID: 39262612
I've requested that this question be closed as follows:

Accepted answer: 50 points for GaryC123's comment #a39262449
Assisted answer: 80 points for Ray_Paseur's comment #a39262368
Assisted answer: 90 points for GaryC123's comment #a39262371
Assisted answer: 0 points for Mikethk's comment #a39262380
Assisted answer: 80 points for GaryC123's comment #a39262397
Assisted answer: 50 points for plusone3055's comment #a39262427
Assisted answer: 70 points for jagadishdulal's comment #a39262485
Assisted answer: 80 points for GaryC123's comment #a39262500

for the following reason:

HTML files can be executed directly with a browser, but .php cant.

You have to install XAMPP and run Apache which would work as some local host for the .php files.
If Apache wont start, its prop... due to port 80 being used by Skype. You can change that port in skype.

All .php files needs to be stored in the htdocs folder, inside of the XAMPP folder, prop... found on main HDD.

You can now launch the .php files by simple telling it to run in a specific browser or by entering http://localhost/index.php (index.php being your .php file), in the URL bar.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39262613
You don't accept your own answer when someone else gave you the answer, just accept the correct answer, being about Skype taking over port 80
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now