You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Neil S. Briscoe" <ne...@censornet.com> on 2008/04/23 15:56:08 UTC

[users@httpd] How to get my script run by the module instead of the execcgi

Hi

OK, originally we intended to use the php5-cgi to run a PHP script.

Having suffered an error and reading through the error logs and the 
suggested solution - we managed to get the source displayed as a page, 
but not to actually execute.  Not quite the intended result.

I have now compiled libapache2-mod-php5 and ensured that it is loaded 
before it is needed.

However, the server is stubbornly insisting on using php5-cgi and not 
using the module.

At least part of this must be because in my <Directory ....> stanza I have

Options ExecCGI

But if I comment this out, I just get a 403 forbidden.

I cannot work out how to ensure that the module is used rather than the 
php5-cgi.

Would someone care to point me in the right direction?

Many thanks.

Regards
Neil

-- 
Neil Briscoe
CensorNet Ltd - professional & affordable Web & E-mail filtering
neil.briscoe@censornet.com web: www.censornet.com
tel: 0845 230 9592 / fax: 0845 230 9591 / main office: 0845 230 9590
snail: The Old Post Office, Bristol Rd, Hambrook, Bristol BS16 1RY. UK.
MSN: nbriscoeuk@hotmail.co.uk

CensorNet Ltd is a registered company in England & Wales No. 05518629
VAT registration number 901-2048-78

Any views expressed in this email communication are those
of the individual sender, except where the sender specifically states
them to be the views of a member of CensorNet Ltd.  CensorNet Ltd does not
represent, warrant or guarantee that the integrity of this communication
has been maintained nor that the communication is free of errors or
interference.

------------------------------------------------------------------------------------
Scanned for viruses, spam and offensive content by CensorNet MailSafe

Professional Web & E-mail Filtering from www.censornet.com
Shortlisted for the BETT Awards 2008! www.bettawards.co.uk

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to get my script run by the module instead of the execcgi

Posted by "Neil S. Briscoe" <ne...@censornet.com>.
Joshua Slive wrote:
> On Wed, Apr 23, 2008 at 4:09 PM, Neil S. Briscoe
> <ne...@censornet.com> wrote:
>> Joshua Slive wrote:
> 
>>> If you show us the relevant part of your configuration, along with
>>> more details on EXACTLY what you see when you request a php script, we
>>> might be able to help.
> 
> What about the second part of what I asked for above? What exactly do
> you see when you make a request? What is in the error and access logs?
> 

Here is a tail from the error log file.

As you can see, it still thinks its running cgi - thats how I knew it 
was using that and not the module.

[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17]
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] <p>This PHP 
CGI binary was compiled with force-cgi-redirect enabled.  This
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] means that a 
page will only be served up if the REDIRECT_STATUS CGI variable is
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] set, e.g. via 
an Apache Action directive.</p>
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] <p>For more 
information as to <i>why</i> this behaviour exists, see the <a 
href="http://php.net/security.cgi-bin">manual page for CGI security</a>.</p>
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] <p>For more 
information about changing this behaviour or re-enabling this webserver,
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] consult the 
installation file that came with this distribution, or visit
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] <a 
href="http://php.net/install.windows">the manual page</a>.</p>
[Wed Apr 23 13:24:47 2008] [error] [client 217.146.111.17] Premature end 
of script headers: vpsinfo.php
[Wed Apr 23 13:26:43 2008] [error] [client 217.146.111.17] client denied 
by server configuration: /var/www/vpsinfo/vpsinfo.php

Regards
Neil

------------------------------------------------------------------------------------
Scanned for viruses, spam and offensive content by CensorNet MailSafe

Professional Web & E-mail Filtering from www.censornet.com
Shortlisted for the BETT Awards 2008! www.bettawards.co.uk

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to get my script run by the module instead of the execcgi

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, Apr 23, 2008 at 4:09 PM, Neil S. Briscoe
<ne...@censornet.com> wrote:
>
> Joshua Slive wrote:

> > If you show us the relevant part of your configuration, along with
> > more details on EXACTLY what you see when you request a php script, we
> > might be able to help.

What about the second part of what I asked for above? What exactly do
you see when you make a request? What is in the error and access logs?

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to get my script run by the module instead of the execcgi

Posted by "Neil S. Briscoe" <ne...@censornet.com>.
Joshua Slive wrote:
> On Wed, Apr 23, 2008 at 9:56 AM, Neil S. Briscoe
> <ne...@censornet.com> wrote:
>> Hi
>>
>>  OK, originally we intended to use the php5-cgi to run a PHP script.
>>
>>  Having suffered an error and reading through the error logs and the
>> suggested solution - we managed to get the source displayed as a page, but
>> not to actually execute.  Not quite the intended result.
>>
>>  I have now compiled libapache2-mod-php5 and ensured that it is loaded
>> before it is needed.
>>
>>  However, the server is stubbornly insisting on using php5-cgi and not using
>> the module.
>>
>>  At least part of this must be because in my <Directory ....> stanza I have
>>
>>  Options ExecCGI
>>
>>  But if I comment this out, I just get a 403 forbidden.
>>
>>  I cannot work out how to ensure that the module is used rather than the
>> php5-cgi.
>>
>>  Would someone care to point me in the right direction?
> 
> Do you have the appropriate AddHandler or AddType to activate the php
> module processing?
> 
> If you show us the relevant part of your configuration, along with
> more details on EXACTLY what you see when you request a php script, we
> might be able to help.
> 

I can most certainly do that.

First of all, just 8% down the httpd.conf I have this line

LoadModule php5_module        modules/libphp5.so

Then, 22% down the file I have this Directory stanza

<Directory /var/www/vpsinfo>
     AllowOverride None
     Options ExecCGI
     AddType application/x-httpd-php php
     Order deny,allow
     AuthType Basic
     AuthName "VPSInfo Service"
     AuthUserFile /usr/local/apache2/conf/passwordfiles/.vpsinfo
     Require valid-user
</Directory>

Both of these parts are in the global configuration section.

Finally, at the end of the file I have this VirtualHost block

<VirtualHost vpsinfo.censornet.com:80>
DocumentRoot "/var/www/vpsinfo/"
ServerName vpsinfo.censornet.com
ServerAdmin support@censornet.com
ErrorLog "/usr/local/apache2/logs/vpsinfo_error_log"
TransferLog "/usr/local/apache2/logs/vpsinfo.log"
#RewriteEngine on
#RewriteCond %{ENV:REDIRECT_STATUS} !=200
#RewriteRule /usr/lib/cgi-bin/php5 - [F]
</VirtualHost>

I hope that helps.

Regards
Neil

------------------------------------------------------------------------------------
Scanned for viruses, spam and offensive content by CensorNet MailSafe

Professional Web & E-mail Filtering from www.censornet.com
Shortlisted for the BETT Awards 2008! www.bettawards.co.uk

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to get my script run by the module instead of the execcgi

Posted by Joshua Slive <jo...@slive.ca>.
On Wed, Apr 23, 2008 at 9:56 AM, Neil S. Briscoe
<ne...@censornet.com> wrote:
> Hi
>
>  OK, originally we intended to use the php5-cgi to run a PHP script.
>
>  Having suffered an error and reading through the error logs and the
> suggested solution - we managed to get the source displayed as a page, but
> not to actually execute.  Not quite the intended result.
>
>  I have now compiled libapache2-mod-php5 and ensured that it is loaded
> before it is needed.
>
>  However, the server is stubbornly insisting on using php5-cgi and not using
> the module.
>
>  At least part of this must be because in my <Directory ....> stanza I have
>
>  Options ExecCGI
>
>  But if I comment this out, I just get a 403 forbidden.
>
>  I cannot work out how to ensure that the module is used rather than the
> php5-cgi.
>
>  Would someone care to point me in the right direction?

Do you have the appropriate AddHandler or AddType to activate the php
module processing?

If you show us the relevant part of your configuration, along with
more details on EXACTLY what you see when you request a php script, we
might be able to help.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org