This is a discussion on php5.0beta and apache2 within the PHP Language forums, part of the PHP Programming Forums category; Hi, I've just installed apache 2 on windows98 and works fine. Then, I install php5.0.0 beta and ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
gustavo wrote:
> 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. This was just my question a few days ago: "> sorry newbie: > 1. is it that <?php (stuff) ?> will NOT work in my index.html file ? 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 |
|
|||
|
tom wrote:
> gustavo wrote: > > >>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. > > > This was just my question a few days ago: > > "> sorry newbie: > >>1. is it that <?php (stuff) ?> will NOT work in my index.html file ? > > 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 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! |
|
|||
|
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! |