Help - Search - Member List - Calendar
Full Version: newbie problems with phpinfo()
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
Pepebuho
Hi, I need some clarification. I was testing the installation of PHP on a
test box and I am puzzled. I created two test files, one works and the other
does not. It seems to me that both should work. Here are the files:

The file that works is phptest.php
The file that does not work is prueba1.html

Thanks!!

Filename: prueba1.html
---------prueba1.html begins ------------
<html>
<head>
<title>Example</title>
</head>
<body>
<?php phpinfo() ; ?>
</body>
</html>
--------prueba1.html ends -----------
--------phptest.php begins ----------
<?php phpinfo(); ?>
--------phptest.php ends ------------

Ian.H [dS]
On Wed, 10 Sep 2003 12:12:35 -0500 in
<message-id:[Email Removed]>
"Pepebuho" <[Email Removed]> wrote:

QUOTE
Hi, I need some clarification. I was testing the installation of PHP
on a test box and I am puzzled. I created two test files, one works
and the other does not. It seems to me that both should work. Here
are the files:

The file that works is phptest.php
The file that does not work is prueba1.html


Are .html files configured to be parsed as PHP files? Doesn't sound like
it from here.



Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Ville Saalo
QUOTE
The file that works is phptest.php
The file that does not work is prueba1.html

That's because the phpinfo() function creates the *entire* web page along
with all the headers and footers. prueba1.html has headers and footers
twice so some browsers won't show it (at least Opera however seems to be
tolerant for this error). <?php phpinfo(); ?> is really the only thing that
is needed. Just look at the source code of the phpinfo() page. You'll
notice that the doctype has been specified (XHTML 1.0 Transitional) and
that there are </body></html> tags at the end. :)

-Ville

newsgroups.bellsouth.net
I copied your code to a new file and called it 1.php

I then ran 1.php and it worked. You have not configured your system to
process html files as PHP. For now it would make more sense to rename the
file extension to PHP...
"Pepebuho" <[Email Removed]> wrote in message
news:[Email Removed]...
QUOTE
Hi, I need some clarification. I was testing the installation of PHP on a
test box and I am puzzled. I created two test files, one works and the
other
does not. It seems to me that both should work. Here are the files:

The file that works is phptest.php
The file that does not work is prueba1.html

Thanks!!

Filename: prueba1.html
---------prueba1.html begins ------------
<html
<head
<title>Example</title
</head
<body
<?php  phpinfo() ; ?
</body
</html
--------prueba1.html ends -----------
--------phptest.php begins ----------
<?php phpinfo(); ?
--------phptest.php ends ------------



Warren Oates
In article <[Email Removed]>,
"Ian.H [dS]" <[Email Removed]> wrote:

: Are .html files configured to be parsed as PHP files? Doesn't sound like
: it from here.

Or to put it another way: if you need to execute php code, you need to
give the page it's on the .php extension.
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.

Pepebuho
"Warren Oates" <[Email Removed]> wrote in message
news:[Email Removed]...
QUOTE
In article <[Email Removed]>,
"Ian.H [dS]" <[Email Removed]> wrote:

: Are .html files configured to be parsed as PHP files? Doesn't sound like
: it from here.

Or to put it another way: if you need to execute php code, you need to
give the page it's on the .php extension.

How do I configure the .html to be parsed as PHP files? All the PHP manual
says about it is to add the LoadModule thing and the AddType
application/x-httpd-php .php thing.

I am going to the Apache manual and look it up, but I would appreciate some
hints. Thanks!
QUOTE
--
Looks like more of Texas to me.
... Arizona, where the nights are warm and the roads are straight.


Warren Oates
In article <[Email Removed]>,
"Pepebuho" <[Email Removed]> wrote:

: I am going to the Apache manual and look it up, but I would appreciate some
: hints. Thanks!

I don't run my own server, so I just name my files so PHP can find them.
--
Looks like more of Texas to me.
.... Arizona, where the nights are warm and the roads are straight.

Jason
If you don't have your own server, put this in an .htaccess file:

AddType application/x-httpd-php .html

and see if it works.



"Pepebuho" <[Email Removed]> wrote in message
news:[Email Removed]...
QUOTE

"Warren Oates" <[Email Removed]> wrote in message
news:[Email Removed]...
In article <[Email Removed]>,
"Ian.H [dS]" <[Email Removed]> wrote:

: Are .html files configured to be parsed as PHP files? Doesn't sound
like
: it from here.

Or to put it another way: if you need to execute php code, you need to
give the page it's on the .php extension.

How do I configure the .html to be parsed as PHP files? All the PHP manual
says about it is to add the LoadModule thing and the AddType
application/x-httpd-php .php thing.

I am going to the Apache manual and look it up, but I would appreciate
some
hints. Thanks!
--
Looks like more of Texas to me.
... Arizona, where the nights are warm and the roads are straight.




ǣw_v_󥦦
Please note that with this method all your html files will have to be phased
through php and will up your server load and response time.

-borgx

"Jason" <[Email Removed]> wrote in message
news:0GW8b.18340$[Email Removed]...
QUOTE
If you don't have your own server, put this in an .htaccess file:

AddType application/x-httpd-php .html

and see if it works.



"Pepebuho" <[Email Removed]> wrote in message
news:[Email Removed]...

"Warren Oates" <[Email Removed]> wrote in message
news:[Email Removed]...
In article <[Email Removed]>,
"Ian.H [dS]" <[Email Removed]> wrote:

: Are .html files configured to be parsed as PHP files? Doesn't sound
like
: it from here.

Or to put it another way: if you need to execute php code, you need to
give the page it's on the .php extension.

How do I configure the .html to be parsed as PHP files? All the PHP
manual
says about it is to add the LoadModule thing and the AddType
application/x-httpd-php .php thing.

I am going to the Apache manual and look it up, but I would appreciate
some
hints. Thanks!
--
Looks like more of Texas to me.
... Arizona, where the nights are warm and the roads are straight.







PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.