473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1463
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bryan Feeney | last post by:
I'm working on a site which dynamically generates tables of rates in CSV format. The script which does the work is called generate_stats.php. Here's the header header ("Content-type:...
4
by: Christian Otteneuer | last post by:
Hello Newsgroup, I have the following problem: I want to write a python script, that writes text into files. The text is being "collected" in a for-loop, the code looks like this: for i in...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
10
by: Åženol Akbulak | last post by:
Hi, I have a form page to print on my web application(asp.net). I want to show the page in WORD. I use that code in asp.net Page_Load event: Response.Clear(); Response.ContentType =...
3
by: MM | last post by:
Hi everybody, what do you think about this problem? I want to create a HTML header file with 2 variables, as below: ----------------------------- $title = "Title of document"; $style =...
7
by: lawrence k | last post by:
I've got a music studio for a client. Their whole studio is run with Macintosh computers. Macintosh computers allow file names to have open white spaces, such as "animal hospital.mp3". I have a...
4
by: JaxDawg | last post by:
I have a spreadsheet saved as an XML spreadsheet so I can manipulate it easier (and don't need COM). When I'm done, I want to display to the user. Currently, I'm using simple JavaScript in my PHP...
0
by: wahyuhid2384 | last post by:
Hi all.. I am creating a small application that supposed to monitor printing activities. I used Win32_PrintJob and successfully get the informations of printing process such as...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.