* Implementing php on an apache server.
@ Mark Rew
` Mitchell Smith
` Aaron Howell
0 siblings, 2 replies; 3+ messages in thread
From: Mark Rew @ UTC (permalink / raw)
To: speakup
List,
I'm getting an internal apache error when I use my lynx browser to test my
.php script referencing it via the url:
lynx http://17158-accl.nws.noaa.gov/cgi-bin/experimental.php
The error is:
"[Tue Sep 3 08:37:01 2002] [error] (13)Permission denied: exec of
/var/www/cgi-bin/experimental.php failed
[Tue Sep 3 08:37:01 2002] [error] [client 140.90.24.51] Premature end of
script headers: /var/www/cgi-bin/experimental.php"
The script appears to work if I execute it from the command line with:
php experimental.php
I think the problem is in my httpd.conf file. Do I need the lines:
"<FilesMatch "\.php(\..+)?$">
SetOutputFilter PHP
</FilesMatch> "
Currently I have my httpd.conf with the following lines uncommented for
triggering php.
"# from httpd.conf
<IfDefine HAVE_PHP>
LoadModule php_module modules/mod_php.so
</IfDefine>
<IfDefine HAVE_PHP3>
LoadModule php3_module modules/libphp3.so
</IfDefine>
<IfDefine HAVE_PHP4>
LoadModule php4_module modules/libphp4.so
</IfDefine>
<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.shtml index.php index.php4
index.php3 index.phtml index.cgi
</IfModule>
<IfModule mod_php4.c>
AddType application/x-httpd-php .php .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>
<IfModule mod_php3.c>
AddType application/x-httpd-php3 .php3
AddType application/x-httpd-php3-source .phps
</IfModule>
<IfModule mod_php.c>
AddType application/x-httpd-php .phtml
</IfModule>
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
AddHandler cgi-script .php
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/""
What am I missing here?
thanks
ps: Thanks for the suggestion to change my /etc/sysconfig/network file. Now
my hostname command is showing the correct information for ythe host name and
domain name.
Mark Rew
e-mail: mark.rew@noaa.gov
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Implementing php on an apache server. Implementing php on an apache server Mark Rew @ ` Mitchell Smith ` Aaron Howell 1 sibling, 0 replies; 3+ messages in thread From: Mitchell Smith @ UTC (permalink / raw) To: speakup remove the line AddHandler cgi-script .php mod_php should be executing this file, but your web server is trying to execute it as a cgi. hope this helps. ----- Original Message ----- From: "Mark Rew" <Mark.Rew@noaa.gov> To: <speakup@braille.uwo.ca> Sent: Wednesday, September 04, 2002 1:58 AM Subject: Implementing php on an apache server. > List, > > I'm getting an internal apache error when I use my lynx browser to test my > .php script referencing it via the url: > lynx http://17158-accl.nws.noaa.gov/cgi-bin/experimental.php > > The error is: > "[Tue Sep 3 08:37:01 2002] [error] (13)Permission denied: exec of > /var/www/cgi-bin/experimental.php failed > [Tue Sep 3 08:37:01 2002] [error] [client 140.90.24.51] Premature end of > script headers: /var/www/cgi-bin/experimental.php" > > The script appears to work if I execute it from the command line with: > php experimental.php > > I think the problem is in my httpd.conf file. Do I need the lines: > > "<FilesMatch "\.php(\..+)?$"> > SetOutputFilter PHP > </FilesMatch> " > > Currently I have my httpd.conf with the following lines uncommented for > triggering php. > > "# from httpd.conf > <IfDefine HAVE_PHP> > LoadModule php_module modules/mod_php.so > </IfDefine> > <IfDefine HAVE_PHP3> > LoadModule php3_module modules/libphp3.so > </IfDefine> > <IfDefine HAVE_PHP4> > LoadModule php4_module modules/libphp4.so > </IfDefine> > > <IfModule mod_dir.c> > DirectoryIndex index.html index.htm index.shtml index.php index.php4 > index.php3 index.phtml index.cgi > </IfModule> > > <IfModule mod_php4.c> > AddType application/x-httpd-php .php .php4 .php3 .phtml > AddType application/x-httpd-php-source .phps > </IfModule> > <IfModule mod_php3.c> > AddType application/x-httpd-php3 .php3 > AddType application/x-httpd-php3-source .phps > </IfModule> > <IfModule mod_php.c> > AddType application/x-httpd-php .phtml > </IfModule> > > AddHandler cgi-script .cgi > AddHandler cgi-script .pl > AddHandler cgi-script .php > > ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"" > > What am I missing here? > > thanks > > ps: Thanks for the suggestion to change my /etc/sysconfig/network file. Now > my hostname command is showing the correct information for ythe host name and > domain name. > > Mark Rew > e-mail: mark.rew@noaa.gov > > > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Implementing php on an apache server. Implementing php on an apache server Mark Rew ` Mitchell Smith @ ` Aaron Howell 1 sibling, 0 replies; 3+ messages in thread From: Aaron Howell @ UTC (permalink / raw) To: speakup Don't put your php scripts in your cgi-bin directory. Your apache server is trying to execute them as cgi rather than interpreting them as php because of the ScriptAlias directive pointing at your cgi-bin directory, which takes precidence over everything else. Regards Aaron On Tue, Sep 03, 2002 at 11:58:44AM -0400, Mark Rew wrote: > List, > > I'm getting an internal apache error when I use my lynx browser to test my > .php script referencing it via the url: > lynx http://17158-accl.nws.noaa.gov/cgi-bin/experimental.php > > The error is: > "[Tue Sep 3 08:37:01 2002] [error] (13)Permission denied: exec of > /var/www/cgi-bin/experimental.php failed > [Tue Sep 3 08:37:01 2002] [error] [client 140.90.24.51] Premature end of > script headers: /var/www/cgi-bin/experimental.php" > > The script appears to work if I execute it from the command line with: > php experimental.php > > I think the problem is in my httpd.conf file. Do I need the lines: > > "<FilesMatch "\.php(\..+)?$"> > SetOutputFilter PHP > </FilesMatch> " > > Currently I have my httpd.conf with the following lines uncommented for > triggering php. > > "# from httpd.conf > <IfDefine HAVE_PHP> > LoadModule php_module modules/mod_php.so > </IfDefine> > <IfDefine HAVE_PHP3> > LoadModule php3_module modules/libphp3.so > </IfDefine> > <IfDefine HAVE_PHP4> > LoadModule php4_module modules/libphp4.so > </IfDefine> > > <IfModule mod_dir.c> > DirectoryIndex index.html index.htm index.shtml index.php index.php4 > index.php3 index.phtml index.cgi > </IfModule> > > <IfModule mod_php4.c> > AddType application/x-httpd-php .php .php4 .php3 .phtml > AddType application/x-httpd-php-source .phps > </IfModule> > <IfModule mod_php3.c> > AddType application/x-httpd-php3 .php3 > AddType application/x-httpd-php3-source .phps > </IfModule> > <IfModule mod_php.c> > AddType application/x-httpd-php .phtml > </IfModule> > > AddHandler cgi-script .cgi > AddHandler cgi-script .pl > AddHandler cgi-script .php > > ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"" > > What am I missing here? > > thanks > > ps: Thanks for the suggestion to change my /etc/sysconfig/network file. Now > my hostname command is showing the correct information for ythe host name and > domain name. > > Mark Rew > e-mail: mark.rew@noaa.gov > > > > _______________________________________________ > Speakup mailing list > Speakup@braille.uwo.ca > http://speech.braille.uwo.ca/mailman/listinfo/speakup -- +----------------------------------------------------------+ / |\ _,,,---,,_ /| / /,`.-'`' -. ;-;;,_ / | / |,4- ) )-,_. ,\ ( `'-' / | / '---''(_/--' `-'\_) / | +----------------------------------------------------------+ | | Aaron Howell Kitten Internet | | | aaron@kitten.net.au Internet consultancy, | | | Phone: +61-417-625550 System administration, | | | fax: +61-7-36010099 system design/integration. | | | icq: 6715521 http://www.kitten.net.au | | | | | | | + | | / | | / | | / | |/ +----------------------------------------------------------+ ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~ UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- Implementing php on an apache server Mark Rew ` Mitchell Smith ` Aaron Howell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).