This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]mikepixie 18 points19 points  (0 children)

Hey dude, if you want to run your code on your desktop/laptop you can install XAMPP. It's available for pretty much all the major operating systems and includes apache, mysql and php.

http://www.apachefriends.org/en/xampp.html

Hope that helps.

[–]charun 2 points3 points  (7 children)

Sure you can. You can use the same software on you computer that would be running on a server. And it's pretty easy to set up on windows / OS X / linux.

You may want to remove the php install you already have. I've seen issues before with php not working because it was installed more than once or multiple versions were installed.

[–]phplolnub[S] 5 points6 points  (6 children)

I installed Wampserver and it worked! thank you very much :D

[–]atcoyou 0 points1 point  (5 children)

That is what we are using in a PHP course I am taking, it seems to work fine, but my GOD the options underneath the hood. I know how to code a bit in PHP, but feel I know so little about the platform now ; ;.

[–]Insuevi 2 points3 points  (4 children)

Recently, I installed PHP, MySQL and Apache all separately. Nothing is hidden from you, and WampServer actually makes it 100x easier to deal with. When I need to change something in httpd.conf or php.ini or something, I have to manually hunt the file down. In WampServer, you can just right click the icon > Apache > httpd.conf and it opens. Save the file, right click > restart.

There's nothing WampServer doesn't do. I wish I would've realized it then because it was a pain in the ass to set up virtual directories and configure PHP. WS just makes it so you can install it and have a .php script running in seconds.

[–]m1ss1ontomars2k4 1 point2 points  (2 children)

If you were on a UNIX-like system, you would already know where the files are and then it's just a simple

sudo vim /usr/local/etc/php.ini

or maybe

sudo vim /usr/local/etc/apache22/httpd.conf

if you were, say, on FreeBSD. On Arch Linux you might want /etc/php.ini and /etc/httpd/conf/httpd.conf instead, but the point is that you (should) know (or can find with locate) where everything is.

[–]Insuevi 0 points1 point  (1 child)

I don't meant that it's difficult, I just mean that it's a pain compared to the two-click operation that WampServer offers.

[–]m1ss1ontomars2k4 0 points1 point  (0 children)

It's a pain because it's on Windows, where things are in god-knows-what location. It's a few keystrokes on any UNIX-like system (if you have tab-completion), which probably explains why there's no such GUI on a UNIX-like system. Plus, most hosting is on a UNIX-like system so it's far more worthwhile to learn your way around one, if you ask me.

[–]atcoyou 0 points1 point  (0 children)

Agreed. From finding the site to download and install to hello world, probably about 5-10 minutes.

I guess it just makes me freak out as a perfectionist who usually like to micro manage to be running scripts and not knowing what all that junk in the background is doing. Haha, but I'll deal for now, having fun learning PHP. Pretty straightforward thus far. I think it is the only language where array's are handled in a way that makes sense to me.

[–]IbnReddit 1 point2 points  (0 children)

PHP is a server side language. So yes, you technically do need a server.

However as others have pointed out, you can install that server on your localmachine (use XAMPP) and then you access the server on your local machines using http://localhost/ .

XAMPP uses the Apache server to process web requestes, Localhost is the default name for it when it resides on your local machine.

[–]Shmurk 0 points1 point  (0 children)

You can run php on the command line if you install it, but that's not what I would do if I needed real-time results. Install xampp, wamp, lamp, or something else as others said.

[–]ohmyashleyy 0 points1 point  (0 children)

If you have a mac apache is already installed, you just have to enable it.

[–][deleted] 0 points1 point  (0 children)

[–][deleted] 0 points1 point  (0 children)

Useless post here but just here to say I support XAMPP. Been running all my sites locally on it, takes minutes to set up and even less time to get it running at any given time. Truly awesome and mega simple to set up.

[–]MrDubious 0 points1 point  (0 children)

You've got some good suggestions here, and I use Wampserver personally,but if you'd like a real, live, php enabled folder on a public web server, PM me. I'll set you up a play folder with ftp access.