Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   PHP (http://www.programmingforums.org/forum29.html)
-   -   installing php (beginners question) (http://www.programmingforums.org/showthread.php?t=14910)

spekkio7 Jan 10th, 2008 7:07 AM

installing php (beginners question)
 
i've been trying to get PHP to work with apache for the last few hours and I'm having a terrible time. I was hoping I could get some help here.

Anyway, i've went over some online guides and i've got apache to work which was pretty easy, and i went through all the steps to set up PHP. at first when i would do that localhost/test.php (test.php being the page i made and was trying to view) i wouldn't get anything at all till eventually i did it and it would ask me if i wanted to download the file (test.php). i'm guessing i did something wrong along the way, and somehow i got it to where it keeps opening the file automatically now, instead of asking me if i want to save / open. I'm using Firefox and I think i accidently clicked the one option that asks if you want to use the same program to open the file everytime which in my case i think is notepad. so now when i run localhost/test.php my file just automatically opens and i see "<? phpphpinfo(); ?>" in notepad. i've changed some things since then and tried IE instead of firefox, but still asks me to open/save to file, isntead of actually displaying the page.

well, that's where i'm at so far. if anybody has an idea of what i'm missing/doing wrong i'd appreciate any input.

edit: btw i'm using apache 2.2.6 and the windows binaries php 5.2.5

Sane Jan 10th, 2008 7:45 AM

Re: installing php (beginners question)
 
I can't give you the exact fix to your problem, but what you're experiencing means Apache doesn't know to associate the PHP interpreter with the .php extention. This is a specification in the httpd.conf file, that either you're missing, or your PHP interpreter is being linked incorrectly.

dr.p Jan 10th, 2008 9:12 AM

Re: installing php (beginners question)
 
There should be a mime-type specification in one of your apache config files for php file. Check your configuration files for "AddType application/x-httpd-php .php" Sounds like that's not in there, and you need to add it if it isn't. Once you add that and restart the web server, your browsers will stop asking you to open/save.

spekkio7 Jan 11th, 2008 12:15 AM

Re: installing php (beginners question)
 
well, in response to the above posts... I do have that line of code, "AddType application/x-httpd-php .php" in my .conf file. it's in the "<IfModule mime_module>" tag. thanks though. i'm still getting the "Do you want to open or save this file?". i guess it would be hard for somebody else to come up with a solution that can't actually see what i've done. i'm still new to this and it seems like there's a lot of room for error. i'll probably start over from the beginning. thanks

Sane Jan 11th, 2008 10:06 AM

Re: installing php (beginners question)
 
You could also post the httpd.conf file, and see if anyone finds a problem. If not, that will at least isolate the issue.

(Remember to post using [code][/code] tags or as a file attachment)


All times are GMT -5. The time now is 3:41 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC