Issue with PHP dev environment on Apache (Windows)

The geek forum. PHP, Perl, HTML, hardware questions etc.. it's all in here. Got a techie question? We'll sort you out. Ask your questions or post a link to your own site here!

Issue with PHP dev environment on Apache (Windows)

Postby Felix » Sun Feb 17, 2008 6:56 pm

Okay so I'm currently trying to set up a PHP development environment with MySQL on my comp so that I can construct a forum and blog for a site I'm making for my youth group. I'm running windows XP and I'm trying to set this up through an Apache server. Everything with Apache and MySQL seems to be running smoothly, but I've run into some problems with PHP.
I followed a tutorial online for configuring PHP for Apache, and everything seems to check out. As far as I know I've put all the files where they need to be, and when I run a config test on Apache everything checks out with no errors, but when I try to load a .php page on firefox through my Apache server, all I get is the raw PHP code, nothing else. And when I try to run it in IE I get a dialog box asking me to download the php file. =/ Any ideas what the problem might be?

Here's some screenshots of the way my folders and config files are set up, so you get a better idea of what's going on here.

Here is the php folder. I haven't touched anything in here. As you can see it's directly on my hard drive.
Image

Now here's the apache folder. I copied the three php files you see from the php folder. The one that's just called php was originally the php.ini-recommended file from the php folder. The only change I made to that file was to designate the root folder for php documents, which is the htdocs folder under the apache folder.
Image

And finally, here's the httpd configuration document which is in the conf folder under the apache folder. I left it alone except for adding the loadmodule lines at the very bottom.
Image


I'll try to give you more info if you need it.
Any help would be much appreciated. =]
User avatar
Felix
 
Posts: 2098
Joined: Mon Dec 13, 2004 10:00 am
Location: Unemployed in Greenland

Postby Kaligraphic » Sun Feb 17, 2008 8:06 pm

You've added the lines in httpd.conf in the wrong place. There's a section with a bunch of LoadModule lines. Put the php LoadModule line at the end there. There's a section with a bunch of AddType lines. Put the php AddType line at the end there. It does matter where in the file you put those lines.
The cake used to be a lie like you, but then it took a portal to the deception core.
User avatar
Kaligraphic
 
Posts: 2002
Joined: Wed Jul 21, 2004 12:00 pm
Location: The catbox of DOOM!

Postby Felix » Sun Feb 17, 2008 8:56 pm

Do I have to keep the <IfModule ssl_module> brackets when I put the LoadModule line at the bottom of the others? Apache won't load the module otherwise. I tried moving them there but nothing has changed. Hmm. I'll have to try something else, since I seem to still be doing it wrong.
User avatar
Felix
 
Posts: 2098
Joined: Mon Dec 13, 2004 10:00 am
Location: Unemployed in Greenland

Postby Mithrandir » Mon Feb 18, 2008 3:40 pm

Hang on...

What happens if you just take off the IfModule declarations? Move the lines mentioned above, but make sure you're actually executing the AddType declaration by removing the IfModule and /IfModule lines.
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby Cap'n Nick » Mon Feb 18, 2008 3:59 pm

I was lazy and used this. For someone like me who's concerned more with writing pages than managing servers it's quite expedient.
User avatar
Cap'n Nick
 
Posts: 1008
Joined: Sat Nov 13, 2004 10:00 am
Location: Kojima, Japan

Postby Mithrandir » Mon Feb 18, 2008 4:44 pm

I'm sure it's a quirk of who I am, but I'm just never comfortable unless I've built the whole system from the ground up.
User avatar
Mithrandir
 
Posts: 11071
Joined: Fri Jun 27, 2003 12:00 pm
Location: You will be baked. And then there will be cake.

Postby Felix » Mon Feb 18, 2008 6:34 pm

Yeah, I took off the IfModule declarations for the AddType line, but if I don't include them with the LoadModule line then it won't load the module. I get an error script when I run a configuration test saying that the module couldn't be loaded. There could be something else that I screwed up a while back while moving things around. I may have to start from scratch.

Wamp will probably work for my purposes, but like Mith, I'd rather build it from the ground up.
User avatar
Felix
 
Posts: 2098
Joined: Mon Dec 13, 2004 10:00 am
Location: Unemployed in Greenland

Postby Felix » Tue Feb 19, 2008 6:37 pm

Aces, I believe I have it cleared up now. ^^ Thanks for the tips guys.
User avatar
Felix
 
Posts: 2098
Joined: Mon Dec 13, 2004 10:00 am
Location: Unemployed in Greenland


Return to Computing and Links

Who is online

Users browsing this forum: No registered users and 22 guests