Reply to Re: I open a PHP file with FF and its content is printed

Your name:

Reply:


Posted by Michael B. Trausch on 04/28/06 08:27

Raistlin Majere wrote in
<1146197942.435073.6610@i40g2000cwc.googlegroups.com> 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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация