Barguast Posted February 18, 2006 Share Posted February 18, 2006 I've recently had to start learning more advanced web development as part of my job, and I'm currently trying to teach myself PHP. However, it is getting to be a bit of a pain to have to upload every script to a server in order to see if it works - especially since, at this early stage, virtually everything I do tends to be wrong! Instead, I'm trying to find a way to run PHP locally. I've been told that to do so I should install Apache Server and PHP5. Unfortunately, it doesn't seem to be that simple since Apache now needs configuring. I can't find any information online about how this is done. Could someone please give me some pointers on how to do this? As I hinted at previously, I don't need to turn my computer into a dedicated server, I just want to be able to test PHP scripts without having to upload them. Of course, if I am barking up the wrong tree and there is a simpler method then do shove me in the right direction. Thanks. Link to comment Share on other sites More sharing options...
segosa Posted February 18, 2006 Share Posted February 18, 2006 xampp: http://www.apachefriends.org/en/xampp.html Link to comment Share on other sites More sharing options...
Barguast Posted February 18, 2006 Author Share Posted February 18, 2006 Well, that seems to have done the trick. Just so I know I'm using it properly - Do I have to place my PHP files in the \xampp\htdocs\ folder and then access them through my browser via localhost? For example, if I saved testphp.php in the htdocs directory then I would access / test it by typing localhost/testphp.php into my browser address bar, correct? If it doesn't sound like I know what I'm talking about, it's because I don't. Thanks for your help. Link to comment Share on other sites More sharing options...
Opius Posted February 19, 2006 Share Posted February 19, 2006 I haven't personally dealt with xampp, but if you open up /apache/conf/httpd.conf and search for a line beginning with 'DocumentRoot', it will tell you the local folder that would respond to http://localhost/. So if it reads something like: DocumentRoot C:/xampp/htdocs/ you would be able to access C:/xampp/htdocs/test.php through http://localhost/test.php. Link to comment Share on other sites More sharing options...
anuj Posted February 19, 2006 Share Posted February 19, 2006 Well, that seems to have done the trick. Just so I know I'm using it properly - Do I have to place my PHP files in the \xampp\htdocs\ folder and then access them through my browser via localhost? For example, if I saved testphp.php in the htdocs directory then I would access / test it by typing localhost/testphp.php into my browser address bar, correct? If it doesn't sound like I know what I'm talking about, it's because I don't. Thanks for your help. That works, yeah. You can also use 127.0.0.1/xxx.php. Personally, I love xampp. I've been using it tons lately. Link to comment Share on other sites More sharing options...
BenMillard Posted February 19, 2006 Share Posted February 19, 2006 (edited) I've been using the Windows, Apache, MySQL and PHP (WAMP) package for a month or two, now. It installed everything with next to zero fuss, just like a regular application installer. I've then made some minor changes to its http.conf file to set things like DocumentRoot but nothing major. It ran perfectly out of the box and is amazingly easy to use from the system tray icon. It starts up in about five seconds, shuts down in less than one. http://localhost/ works correctly, I can play games while it's on with no problems, etc. I sometimes forget it's even running! (EDIT) I've been tinkering with simple PHP for a couple of months and having a local server has made a massive difference to development times. Since it's faster to test stuff I make, it has motivated me to try out more stuff and learn more. Edited February 20, 2006 by Cerbera Link to comment Share on other sites More sharing options...
Barguast Posted February 20, 2006 Author Share Posted February 20, 2006 Yep, it's working fine now. Two days in and I've already coded a basic guestbook type thingy! Thanks all. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now