468,119 Members | 1,870 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

I open a PHP file with FF and its content is printed

I have Apache/MySQL/PHP on Windows XP.

I want my PHP files to behave in my computer like in web host.

I open a PHP file with FF and its content is printed!

Apr 28 '06 #1
6 1244
"Raistlin Majere" <pe******@uol.com.br> wrote in message
news:11********************@i40g2000cwc.googlegrou ps.com...
I have Apache/MySQL/PHP on Windows XP.

I want my PHP files to behave in my computer like in web host.

I open a PHP file with FF and its content is printed!


1) Are you acessing the files with c:/path/to/docroot/file.php or
http://localhost/file.php ? You should be using the latter one.

2) Is Apache+PHP configured properly? Is Apache set to execute .php files
with your php?

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Apr 28 '06 #2
Raistlin Majere wrote in
<11********************@i40g2000cwc.googlegroups.c om> on Fri April 28 2006
00:19:
I have Apache/MySQL/PHP on Windows XP.

I want my PHP files to behave in my computer like in web host.

I open a PHP file with FF and its content is printed!


Well, you didn't provide a heck of a lot of information, so I'll try to help
you with what I can. I'm going to make the assumption that you're using
http://localhost/ or something similar as the base for the URL and when you
load the PHP script that way, you're getting the entire script's source
code on your screen as opposed to the parsed and printed output of the
script. I'm going to wager a guess that no matter what browser you open it
up with, you're getting the same result, thereby not making it specific to
Firefox, but more likely specific to the installation of Apache that you're
running.

If that is the case, then you'll have to tell Apache that it needs to
recognize files ending in .php to be server side scripts. Ensure that the
PHP module is loaded and that the following incantation exists somewhere in
your Apache httpd.conf file:

AddType application/x-httpd-php .php

Is the line that you're going to need to your Apache configuration file to
make that work. You can also optionally have it print the source in a
pretty, syntax highlighted fashion if you add

AddType application/x-httpd-php-source .phps

to your Apache configuration file, but never do this on a machine to the
outside world, if you have phps files lying around. They can give away
things like your passwords and the like and be a big security risk in
general. My personal opinion is that if you want pretty printing of the
source code, you're going to be using a relatively decent IDE, anyway.

If I've not addressed your problem, please provide more information so that
I or somebody else can help you. There are tutorials on the Internet that
you can use to get the system configured correctly, and IIRC, there's even
an installer for all of these things on Windows that does the work for you,
including adding MySQL to the bunch and configuring it as an extension to
PHP as required.

- Mike

Apr 28 '06 #3
How can I properly configure Apache+PHP?

Apr 28 '06 #4
"Ensure that the PHP module is loaded" How?

Apr 28 '06 #5
"Raistlin Majere" <pe******@uol.com.br> wrote in message
news:11**********************@y43g2000cwc.googlegr oups.com...
How can I properly configure Apache+PHP?


Read the f***ing manual:

http://fi2.php.net/manual/en/install...ws.apache1.php
if you have Apache 1.3 version or

http://fi2.php.net/manual/en/install...ws.apache2.php
if you have Apache 2.0 version

--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
sp**@outolempi.net | Gedoon-S @ IRCnet | rot13(xv***@bhgbyrzcv.arg)
Apr 28 '06 #6
Raistlin Majere wrote:
"Ensure that the PHP module is loaded" How?


It sounds like you are

a) trying to achieve something way over your head
b) too lazy to read the manuals
c) unaware of google
e) utterly dyslexic
f) braindead
g) any permutation of the above

May I suggest installing XAMPP or any similar prefab server package ?
Just barking staccato questions each time you run into problems isn't
what usenet was made for.

Come back if you have READ thoroughly, tried and failed. Then be
specific about your problem, concise and complete.

Sh.
--
What GOOD is a CARDBOARD suitcase ANYWAY?
Apr 28 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Bryan Feeney | last post: by
4 posts views Thread by Christian Otteneuer | last post: by
reply views Thread by Dune | last post: by
10 posts views Thread by Ĺženol Akbulak | last post: by
4 posts views Thread by JaxDawg | last post: by
15 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.