954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP without server

Is there any way for me to get a .php file to open in a web browser without a server?

jdam7459
Newbie Poster
12 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 
jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

Yes this is possible. You can setup a server on localhost (127.0.0.1). Google easyPHP. If you need any more assistance with setting up the application. Give me a shout

macneato
Posting Pro in Training
421 posts since Jun 2007
Reputation Points: 46
Solved Threads: 48
 
You can setup a server on localhost



did you even read the original post?without a server?

so, the answer is no

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

Technically no. But he propably just didn't phrase the question right.

macneato
Posting Pro in Training
421 posts since Jun 2007
Reputation Points: 46
Solved Threads: 48
 

how would i set that up im trying to learn php!?!? im curious

jdam7459
Newbie Poster
12 posts since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Take a look at XAMPP (there are many others). Its an all-in-one kit that installs apache, php and mysql on your windows PC

jbennet
Moderator
Moderator
18,523 posts since Apr 2005
Reputation Points: 1,826
Solved Threads: 601
 

with easyphp you dont have to setup nothing. download, install, open application. [CLICK ON THE LITTLE TRAFFIC LIGHT]. If the light goes green your good to go.
In your browser, type in "http://127.0.0.1" or right click on your active application icons (near the clock) you'll get an option to view easyphp localweb. lastly, move all your php documents into installation directory%easyphp/www/

MAGIC. it works

dont forget to refresh browser

macneato
Posting Pro in Training
421 posts since Jun 2007
Reputation Points: 46
Solved Threads: 48
 

PHP includes a command-line interpreter. You can run your PHP script through that, direct the output to a file and open that file in the web browser.

So, yes, it's possible. It quickly gets tiring, though. That's why most developers use EasyPHP or XAMPP on their machines.

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

Hi, This post is very informative, however I would like some specific information. If someone can help me then please send me a private message. Best Regards,

Nicky Butt
Newbie Poster
1 post since Jun 2007
Reputation Points: 10
Solved Threads: 0
 

Nicky... If it's related to this thread. Post here. If nt start a new one.

macneato
Posting Pro in Training
421 posts since Jun 2007
Reputation Points: 46
Solved Threads: 48
 

I tried saving the file as site1.php. The php extension won't work.

DCboy84
Newbie Poster
1 post since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

On a mac, all you have to do is install PHP and use the built-in apache server.
If your on linux I'd install a lamp package.
However, if you are on windows (which I think so...) I wouldn't really recommend using a package, and doing it by installing the Apache package, then PHP.
That should work just fine.
You can also use an emulated enviroment in the Aptana software suite -- http://aptana.com/studio/download
so you can run php files.
If you just want to look at the file's source, right-click it and say, open with notepad (or equivalent).
- CodeJoust.com

codejoust
Junior Poster
180 posts since Jul 2009
Reputation Points: 18
Solved Threads: 21
 

On windoze I use DevPHP, a php ide with php and a localhost build
from sourceforge

almostbob
Posting Sensei
3,149 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

PHP scripts can be run using the php-cgi.exe command line interface.

However, a web server is a must if you want to have full functionality of the script. "Viewer for PHP" is an open source app that can be used to run scripts in an embedded browser control. It makes use of the mongoose web server, however you simply run the .exe file and everything else is taken care of.

check it out at:

http://viewerforphp.sourceforge.net/

nika201
Newbie Poster
11 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

Hi Nicky,

Would probably be better if you add to this thread or start a new one, so that the solution is freely available.

macneato
Posting Pro in Training
421 posts since Jun 2007
Reputation Points: 46
Solved Threads: 48
 
Technically no. But he propably just didn't phrase the question right.

WellI for one found your answer quite helpful. Many thanks!

Arcrammer
Newbie Poster
17 posts since Feb 2011
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You