Testing your PHP scripts locally?

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
User avatar
CKEANEDesign
Forum Newbie
Posts: 19
Joined: Thu Mar 26, 2009 8:04 am

Testing your PHP scripts locally?

Post by CKEANEDesign »

Hey guys! Is there anyway to test your PHP scripts locally? I know opening a .php file locally in firefox doesn't work.

Can someone help me out with that?
Thanks!
-PHP Noob Cory
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Testing your PHP scripts locally?

Post by papa »

If you have apache installed you use localhost.
User avatar
CKEANEDesign
Forum Newbie
Posts: 19
Joined: Thu Mar 26, 2009 8:04 am

Re: Testing your PHP scripts locally?

Post by CKEANEDesign »

papa wrote:If you have apache installed you use localhost.
Okay cool. Thanks, pal!

But obviously you can't view websites with php locally and use the SQL content right? like i cant sign on to an account (that's in the site server's database) on a website i made locally right?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Testing your PHP scripts locally?

Post by papa »

Sure you can.

I use wamp which is very easy to install. There you have apache, php and MySQL and you can set up exactly as you have it on your webhosting provider for example and test everything first before you upload it "live".

You can easily export tables or the whole database in mysqladmin and import it where ever you want it.
User avatar
CKEANEDesign
Forum Newbie
Posts: 19
Joined: Thu Mar 26, 2009 8:04 am

Re: Testing your PHP scripts locally?

Post by CKEANEDesign »

papa wrote:Sure you can.

I use wamp which is very easy to install. There you have apache, php and MySQL and you can set up exactly as you have it on your webhosting provider for example and test everything first before you upload it "live".

You can easily export tables or the whole database in mysqladmin and import it where ever you want it.
awesome man. really appreciate it! ;)
User avatar
CKEANEDesign
Forum Newbie
Posts: 19
Joined: Thu Mar 26, 2009 8:04 am

Re: Testing your PHP scripts locally?

Post by CKEANEDesign »

oh one more thing! you know of any programs like wamp that are for the macintosh operating system?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Testing your PHP scripts locally?

Post by papa »

This should do it:
http://lamphowto.com/

LAMP
User avatar
CKEANEDesign
Forum Newbie
Posts: 19
Joined: Thu Mar 26, 2009 8:04 am

Re: Testing your PHP scripts locally?

Post by CKEANEDesign »

papa wrote:This should do it:
http://lamphowto.com/

LAMP
hmm seems to be for linux
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Testing your PHP scripts locally?

Post by papa »

Sorry MAMP is what you need. Not really familiar with the other ones:

http://www.google.se/search?client=fire ... C3%B6kning
User avatar
CKEANEDesign
Forum Newbie
Posts: 19
Joined: Thu Mar 26, 2009 8:04 am

Re: Testing your PHP scripts locally?

Post by CKEANEDesign »

papa wrote:Sorry MAMP is what you need. Not really familiar with the other ones:

http://www.google.se/search?client=fire ... C3%B6kning
beautiful! installing now. hopefully it works well! thx 4 all ur help
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Testing your PHP scripts locally?

Post by papa »

NP, good luck and welcome to the family. :)
Post Reply