php5.0beta and apache2

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gustavo

    php5.0beta and apache2

    Hi, I've just installed apache 2 on windows98 and works fine.
    Then, I install php5.0.0 beta and works as expected, but some
    restrictions apply.

    Im a newbie to php, and I dont know why, when I request at
    the server the test.html it dont send me the results of
    the php script in that (dot) html file, but if I change the
    extension to (dot) php and I request that file (test.php) the
    server shows me the results of the php script.

    What Im doing wrong? Its something in the httpd.conf of the
    apache server?

    Any feedback would be appreciated. Thanks in advance.
  • tom

    #2
    Re: php5.0beta and apache2

    gustavo wrote:
    [color=blue]
    > Hi, I've just installed apache 2 on windows98 and works fine.
    > Then, I install php5.0.0 beta and works as expected, but some
    > restrictions apply.
    >
    > Im a newbie to php, and I dont know why, when I request at
    > the server the test.html it dont send me the results of
    > the php script in that (dot) html file, but if I change the
    > extension to (dot) php and I request that file (test.php) the
    > server shows me the results of the php script.
    >
    > What Im doing wrong? Its something in the httpd.conf of the
    > apache server?
    >
    > Any feedback would be appreciated. Thanks in advance.[/color]

    This was just my question a few days ago:

    "> sorry newbie:[color=blue]
    > 1. is it that <?php (stuff) ?> will NOT work in my index.html file ?[/color]
    Will only work if the webserver has been told to send .html files to PHP."

    and

    "Yes, very normal.
    But you can configure your HTTP server to pass whetever pages you want
    to the PHP engine.
    Check "AddType" for Apache's httpd.conf
    For example:
      AddType application/x-httpd-php .php .phtml .html .script
    will serve php from files ending in .php, .phtml, .html, and .script"

    see helpful responses, in context even, from Andrew, Pedro, Ed and Count in
    "Re: getting started - gui and file organisation" and "<?php in .html
    files ??" messages below

    regards, tom



    Comment

    • Agelmar

      #3
      Re: php5.0beta and apache2

      tom wrote:[color=blue]
      > gustavo wrote:
      >
      >[color=green]
      >>Hi, I've just installed apache 2 on windows98 and works fine.
      >>Then, I install php5.0.0 beta and works as expected, but some
      >>restriction s apply.
      >>
      >>Im a newbie to php, and I dont know why, when I request at
      >>the server the test.html it dont send me the results of
      >>the php script in that (dot) html file, but if I change the
      >>extension to (dot) php and I request that file (test.php) the
      >>server shows me the results of the php script.
      >>
      >>What Im doing wrong? Its something in the httpd.conf of the
      >>apache server?
      >>
      >>Any feedback would be appreciated. Thanks in advance.[/color]
      >
      >
      > This was just my question a few days ago:
      >
      > "> sorry newbie:
      >[color=green]
      >>1. is it that <?php (stuff) ?> will NOT work in my index.html file ?[/color]
      >
      > Will only work if the webserver has been told to send .html files to PHP."
      >
      > and
      >
      > "Yes, very normal.
      > But you can configure your HTTP server to pass whetever pages you want
      > to the PHP engine.
      > Check "AddType" for Apache's httpd.conf
      > For example:
      > AddType application/x-httpd-php .php .phtml .html .script
      > will serve php from files ending in .php, .phtml, .html, and .script"
      >
      > see helpful responses, in context even, from Andrew, Pedro, Ed and Count in
      > "Re: getting started - gui and file organisation" and "<?php in .html
      > files ??" messages below
      >
      > regards, tom[/color]

      While you *can* set up your webserver, unless you have a **very** good
      reason to, you should *not*. If you set up your webserver to do this,
      your server will have to parse all .html files for PHP, even if there's
      no PHP in them. This is a senseless waste... if you have a PHP file,
      name it .php!

      Comment

      • gustavo

        #4
        Re: php5.0beta and apache2

        Thanks for your help, I began to understand how it works,
        there was a moment before I ask for help that I think
        "I love Apapche, does it love me?", these kind of thoughts
        come to me when things goes wrong, thanks again for your
        valued help. In this right moment I think
        Apache (and PHP) loves me!

        Comment

        Working...