Professional Web Applications Themes

newbie problems with phpinfo() - PHP Development

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 ------------...

  1. #1

    Default newbie problems with phpinfo()

    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 ------------


    Pepebuho Guest

  2. #2

    Default newbie problems with phpinfo()

    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 ------------


    Pepebuho Guest

  3. #3

    Default Re: newbie problems with phpinfo()

    > 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
    Ville Saalo Guest

  4. #4

    Default Re: newbie problems with phpinfo()

    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" <p1e2p3e4b5u6h7o8pananet.com> wrote in message
    news:bjnm2901t7benews2.newsguy.com...
    > 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 ------------
    >
    >

    newsgroups.bellsouth.net Guest

  5. #5

    Default Re: newbie problems with phpinfo()


    "Warren Oates" <WarrenInHell.Com> wrote in message
    news:Warren-B7FD85.18144510092003nr-tor01.bellnexxia.net...
    > In article <20030910185004.5f4ffac6.ianWINDOZEdigiserv.net >,
    > "Ian.H [dS]" <ianWINDOZEdigiserv.net> wrote:
    >
    > : Are .html files configured to be pd 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 pd 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.

    Pepebuho Guest

  6. #6

    Default Re: newbie problems with phpinfo()


    "Warren Oates" <WarrenInHell.Com> wrote in message
    news:Warren-B7FD85.18144510092003nr-tor01.bellnexxia.net...
    > In article <20030910185004.5f4ffac6.ianWINDOZEdigiserv.net >,
    > "Ian.H [dS]" <ianWINDOZEdigiserv.net> wrote:
    >
    > : Are .html files configured to be pd 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 pd 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.

    Pepebuho Guest

  7. #7

    Default Re: newbie problems with phpinfo()

    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" <p1e2p3e4b5u6h7o8pananet.com> wrote in message
    news:bjrln105f1enews3.newsguy.com...
    >
    > "Warren Oates" <WarrenInHell.Com> wrote in message
    > news:Warren-B7FD85.18144510092003nr-tor01.bellnexxia.net...
    > > In article <20030910185004.5f4ffac6.ianWINDOZEdigiserv.net >,
    > > "Ian.H [dS]" <ianWINDOZEdigiserv.net> wrote:
    > >
    > > : Are .html files configured to be pd 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 pd 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.
    >
    >
    >

    Jason Guest

  8. #8

    Default Re: newbie problems with phpinfo()

    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" <p1e2p3e4b5u6h7o8pananet.com> wrote in message
    news:bjrln105f1enews3.newsguy.com...
    >
    > "Warren Oates" <WarrenInHell.Com> wrote in message
    > news:Warren-B7FD85.18144510092003nr-tor01.bellnexxia.net...
    > > In article <20030910185004.5f4ffac6.ianWINDOZEdigiserv.net >,
    > > "Ian.H [dS]" <ianWINDOZEdigiserv.net> wrote:
    > >
    > > : Are .html files configured to be pd 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 pd 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.
    >
    >
    >

    Jason Guest

  9. #9

    Default Re: newbie problems with phpinfo()

    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" <rr.com> wrote in message
    news:0GW8b.18340$tampabay.rr.com... [/ref]
    > like 
    >>
    >> How do I configure the .html to be pd 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[/ref]
    > some 
    >>
    >>
    >>[/ref]
    >
    >[/ref]


    ǣw_v_󥦦 Guest

Similar Threads

  1. Recordset SQL problems from a newbie
    By skolnick in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: November 15th, 10:07 AM
  2. Newbie problems
    By Bryan Dickerson in forum ASP.NET Web Services
    Replies: 0
    Last Post: April 21st, 01:53 PM
  3. photo problems for Illustrator newbie
    By pentimento@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 18
    Last Post: May 13th, 01:15 PM
  4. Newbie problems with > in a string
    By Albert Browne in forum PERL Beginners
    Replies: 3
    Last Post: December 27th, 04:05 PM
  5. newbie - button problems
    By naughtydog in forum Macromedia Flash
    Replies: 2
    Last Post: November 17th, 11:38 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139