Running PHP code locally (NOT on a server or for a server)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CGameProgrammer
Forum Newbie
Posts: 11
Joined: Sun Mar 09, 2003 11:26 pm

Running PHP code locally (NOT on a server or for a server)

Post by CGameProgrammer »

I want to convert my existing site (http://www.devimg.net) from ASP to PHP. I'm a PHP newbie and the current host (Brinkster) doesn't support PHP so I need to get an account elsewhere, but before I do that I want to get a working PHP version of my site to make sure I can do it with no drawbacks.

Since there aren't any good free webhosts, I want to just develop and run the scripts on my hard drive; the internet doesn't need to be involved at all. So how do I do that? PHP.net seems geared completely towards people running webservers, which makes sense, but all I want to do is run PHP code to generate HTML (or access files, or work with MySQL).

EDIT: It doesn't actually have to be MySQL, it could be any database type, it's really not very hard converting code from one to the other. I say this just in case MySQL isn't free, though I believe it is, right?
User avatar
lazy_yogi
Forum Contributor
Posts: 243
Joined: Fri Jan 24, 2003 3:27 am

Post by lazy_yogi »

If you're on windows, then u can get php-triad and it installs php, mysql and apache for you. Thats what i did ... its incredibly easy
and btw .. there is a free web host for practicing php http://www.f2o.org
CGameProgrammer
Forum Newbie
Posts: 11
Joined: Sun Mar 09, 2003 11:26 pm

Post by CGameProgrammer »

Hey, thanks, php-triad was apparently exactly the kind of thing I was looking for. Very easy to setup too. Awesome.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

only as an addition: now you have a working webserver. The last time I tried phpTriad it installed the webserver accessible from the internet connection. So, if you want to show someone you're efforts you might populate the ip and they can take a look ;)
CGameProgrammer
Forum Newbie
Posts: 11
Joined: Sun Mar 09, 2003 11:26 pm

Post by CGameProgrammer »

Yeah, I guessed that, since Apache is running. All I'd need to do is tell them my IP# and then they'd type in http://123.45.678.9/index.php to access C:\apache\htdocs\index.php, correct?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

to access C:\apache\htdocs\index.php
or whereever your DocumentRoot is pointing to, right.
Post Reply