apache 2.0.39 | setting up for PHP pages

apache 2.0.39 | setting up for PHP pages

Post by evan.co.. » Tue, 14 Jan 2003 00:50:30



Greetings -

Running apache 2.0.39 on RH 7.3, with a recent flavor of PHP installed
(standalone - not as mod_php). I want to install and run a package
that requires processing/accessing files with a .php extension.

I added the following to my httpd.conf file

ScriptAlias /php/ "/usr/bin/php"

and

AddType application/x-httpd-php .php .php4 .phtml

I restarted httpd, and yet, whenever I try to access a file with a
php extension, rather than executing it (i.e., displaying it in the
browser), it asks me if I want to save it to disk (it shouldn't
matter, but I'm using Mozilla for my borwser).

I suspect I've either done some wrong with the ScriptAlias or AddType
directives, but after several attempts, can't figure out what.
Alternatively, they may be correct, but I need something else in the
httpd.conf file.

Any suggestions (pointers to the obvious)?

Thanks!

 
 
 

apache 2.0.39 | setting up for PHP pages

Post by evan.co.. » Tue, 14 Jan 2003 03:47:20



>Greetings -

>Running apache 2.0.39 on RH 7.3, with a recent flavor of PHP installed
>(standalone - not as mod_php). I want to install and run a package
>that requires processing/accessing files with a .php extension.

Actually, I'm wondering if its a PHP, Apache 2 problem. My box has PHP
4.1.27. I think I remember reading somewhere that Apache 2 is
compatible only with PHP 4.2 or above.

Can someone confirm (one way or the other)?

Thanks!

 
 
 

apache 2.0.39 | setting up for PHP pages

Post by 2Host.com - Rober » Tue, 14 Jan 2003 11:28:48




> >Greetings -

> >Running apache 2.0.39 on RH 7.3, with a recent flavor of PHP installed
> >(standalone - not as mod_php). I want to install and run a package
> >that requires processing/accessing files with a .php extension.

> Actually, I'm wondering if its a PHP, Apache 2 problem. My box has PHP
> 4.1.27. I think I remember reading somewhere that Apache 2 is
> compatible only with PHP 4.2 or above.

> Can someone confirm (one way or the other)?

> Thanks!

I've not heard this, but I really don't know. I do know that you should
upgrade to the newest version anyway, due to bugs and security issues. I
can't imagine why you'd want to use a build that old?
--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com
 
 
 

apache 2.0.39 | setting up for PHP pages

Post by 2Host.com - Rober » Tue, 14 Jan 2003 11:30:12



> Greetings -

> Running apache 2.0.39 on RH 7.3, with a recent flavor of PHP installed
> (standalone - not as mod_php). I want to install and run a package
> that requires processing/accessing files with a .php extension.

> I added the following to my httpd.conf file

> ScriptAlias /php/ "/usr/bin/php"

> and

> AddType application/x-httpd-php .php .php4 .phtml

> I restarted httpd, and yet, whenever I try to access a file with a
> php extension, rather than executing it (i.e., displaying it in the
> browser), it asks me if I want to save it to disk (it shouldn't
> matter, but I'm using Mozilla for my borwser).

If you aren't running it as a module, you must have it configured for
CGI.
--
Regards,

Server admin, support & programing for shared & dedicated web servers
Secure, reliable hosting you expect and deserve! http://www.2host.com
 
 
 

apache 2.0.39 | setting up for PHP pages

Post by evan.co.. » Tue, 14 Jan 2003 22:47:39


On Sun, 12 Jan 2003 18:28:48 -0800, "2Host.com - Robert"




>> >Greetings -

>> >Running apache 2.0.39 on RH 7.3, with a recent flavor of PHP installed
>> >(standalone - not as mod_php). I want to install and run a package
>> >that requires processing/accessing files with a .php extension.

>> Actually, I'm wondering if its a PHP, Apache 2 problem. My box has PHP
>> 4.1.27. I think I remember reading somewhere that Apache 2 is
>> compatible only with PHP 4.2 or above.

>> Can someone confirm (one way or the other)?

>> Thanks!

>I've not heard this, but I really don't know. I do know that you should
>upgrade to the newest version anyway, due to bugs and security issues. I
>can't imagine why you'd want to use a build that old?

Simple reason - RH (as with most distros) build a bunch of scripts
that assume certain versions of various scripting languages are
available. I tried upgrading Python recently, and it screwed up so
many things, I ended up having to re-install from scratch.
 
 
 

apache 2.0.39 | setting up for PHP pages

Post by oleg » Tue, 14 Jan 2003 23:46:48


Hello, 2Host.com!
You wrote  on Sun, 12 Jan 2003 18:30:12 -0800:

 >> I added the following to my httpd.conf file
 >> ScriptAlias /php/ "/usr/bin/php"
 >> and
 >> AddType application/x-httpd-php .php .php4 .phtml

 >> I restarted httpd, and yet, whenever I try to access a file with a
 >> php extension, rather than executing it (i.e., displaying it in the
 >> browser), it asks me if I want to save it to disk (it shouldn't
 >> matter, but I'm using Mozilla for my borwser).

have you tried an Action directive?

Action sphp /cgi-bin/php
AddHandler sphp .php .phtml

/cgi-bin/php contents  is "#!/usr/local/bin/php" it works for me,
and it gives you real security with SuExecUserGroup, because /cgi-bin/php
uid is user's uid.

With best regards, olegs.