RE: [PHP] installing php on apache
| From: | Ben Bleything | Date: | Sun, 08 Jul 2001 17:22:07 +0000 |
| Subject: | RE: [PHP] installing php on apache | ||
| References: | 1 | Groups: | php.general php.install php.windows |
| Request: | Send a blank email to php-general+get-56780@lists.php.net to get a copy of this message | ||
You say. . .
"But I shutdown and restart apache and try to run load a .html file in
my browser"
Did you mean a .php file? My guess is that this is likely to be your
problem. Unless you make the change I specified, apache _will not_
parse any php code in a .html file (or any other file, except a .php).
If you did everything else exactly as the documentation told you, and
apache otherwise runs correctly, AND you can invoke 'php foo.php' on the
command line and it will output correctly (make a file that contains
'<?php phpinfo(); ?>' in the c:\php directory, and php yourfile.php. If
you see a ton of stuff scroll by, php is working), then there is likely
to be a problem with your configuration. This will be difficult to find
without being able to see your httpd.conf file.
Ben
-----Original Message-----
From: Michael Duxbury [mailto:M.R.Duxbury@btinternet.com]
Sent: Sunday, July 08, 2001 10:20 AM
To: php-general@lists.php.net; php-windows@lists.php.net;
php-install@lists.php.net
Subject: Re: [PHP] installing php on apache
Thanks,
> Second, rename any files that have php in them to .php files, and
I already name my PHP files .php
> instruct Apache to look for index.php files (I forget where this is...
I
> believe it's towards the bottom of the default httpd.conf file)
I can't seem to find this part of the document the only mention of PHP
in my
file is like this:
# For example, the PHP3 module (not part of the Apache distribution)
# will typically use:
#
#AddType application/x-httpd-php3 .phtml
#AddType application/x-httpd-php3-source .phps
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
Action application/x-httpd-php c:/php/php.exe
Does this mean that there is another problem that is stopping me running
php?
"Ben Bleything" <bleythbe@mailbox.orst.edu> wrote in message
news:001b01c107cb$73e445e0$0201a8c0@c1141975c...
> The key here is this line:
> AddType application/x-httpd-php .php
>
> What this means, to apache, is that it will only send to the php
binary
> files that end in .php. Two options: first, if you are going to have
> php in almost all files, you can just add .html to this line after
.php.
>
> Second, rename any files that have php in them to .php files, and
> instruct Apache to look for index.php files (I forget where this is...
I
> believe it's towards the bottom of the default httpd.conf file)
>
> Another thing that I noticed when I was trying to install php and
apache
> in windows was that it is very easy to put in both sets of
> descriptions... the one for the module and the one for the binary, so
> just be sure you didn't do that =>
>
> Ben
>
> -----Original Message-----
> From: Michael Duxbury [mailto:M.R.Duxbury@btinternet.com]
> Sent: Sunday, July 08, 2001 5:37 AM
> To: php-windows@lists.php.net; php-install@lists.php.net;
> php-general@lists.php.net
> Subject: [PHP] installing php on apache
>
> I am trying in vain to get php running.
>
> I have win98 and apache1.3.6 server running.
>
> I unzipped the php-4.0.6-Win32 into c:\php
>
> I then downloaded php406-installer and I ran that, did a standard
> install.
>
> I was told that the installer hadn't edited my httpd.conf file for
> apache
> and i would have to do this with accordance with the php\install.txt
> file.
> Which has the following instructions:-
> If you unzipped the PHP package to C:\PHP\ as desribed
> above, you need to insert these lines to your Apache conf
> file to set up the CGI binary:
>
> ScriptAlias /php/ "c:/php/"
> AddType application/x-httpd-php .php
> Action application/x-httpd-php "/php/php.exe"
>
> So this I did, so my httpd.conf file within apache looks like this:-
> # For example, the PHP3 module (not part of the Apache distribution)
> # will typically use:
> #
> #AddType application/x-httpd-php3 .phtml
> #AddType application/x-httpd-php3-source .phps
> ScriptAlias /php/ "c:/php/"
> AddType application/x-httpd-php .php
> Action application/x-httpd-php "c:/php/php.exe"
>
> But I shutdown and restart apache and try to run load a .html file in
my
> browser
> <html>
> <head>
> <title>Untitled Document</title>
> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
> </head>
>
> <body bgcolor="#FFFFFF" text="#000000">
> <?php echo "Hello World<p>"; ?>
> </body>
> </html>
>
> But nothing happens.
>
> I have tried to be as verbose as possible in the hope that someone can
> help
> me out here.
>
> Thankyou.
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
php-list-admin@lists.php.net
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net