php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31855 <IfModule sapi_apache2.c> false
Submitted: 2005-02-05 21:39 UTC Modified: 2005-02-07 01:04 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: michael at stellarent dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 5.0.3 OS: Fedora Core 2
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: michael at stellarent dot com
New email:
PHP Version: OS:

 

 [2005-02-05 21:39 UTC] michael at stellarent dot com
Description:
------------
Hi,

This does not work:

<IfModule sapi_apache2.c>
 php_admin_flag engine on
</IfModule>

My compilation is fine, no errors, and I know php works. This for instance works:

<IfModule mod_php5.c>
 php_admin_flag engine on
</IfModule>

I am compiling from .src.rpm, with:
--with-apxs2=/usr/sbin/apxs

I have tried everything I could think of, but still no joy. Any ideas?


Expected result:
----------------
my php script to be executed.

Actual result:
--------------
the php script is not executed, instead I get the "Save File..." dialogue box.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-05 21:42 UTC] michael at stellarent dot com
I am using httpd-2.0.51-2.9
 [2005-02-07 00:49 UTC] sniper@php.net
I don't know what the bug is if this works:

<IfModule mod_php5.c>
 php_admin_flag engine on
</IfModule>


 [2005-02-07 00:53 UTC] michael at stellarent dot com
Shouldn't sapi_apache2.c work? I mean valuate to true?
I am using Plesk v7.5.2 Reloaded, and every time a new domain is added, the entire httpd.conf file is re-written. Therefore, I am unable to use mod_php5.c.
 [2005-02-07 01:01 UTC] michael at stellarent dot com
Below is an extract of the httpd.include which is re-written by Plesk. The top section switches off php globally, and for each vhost, sapi_apace2.c is used to switch php on. But since sapi_apache2.c is evaluating to false, php remains switched off.

It would be useless for me to change the file from sapi_apache2.c to mod_php5.c because the changes will be lost the next time a new domain is added.

In any case, why does sapi_apache2.c evaluate to false? I don't get it?

-------------------------------------------
<Directory "/home/httpd/vhosts">
        AllowOverride All
        Options SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
        php_admin_flag engine off
</Directory>

<VirtualHost \
                        ***ip remmed out***:80 \
                        >
        ServerName default
        UseCanonicalName Off
        DocumentRoot /home/httpd/vhosts/default/htdocs
        ScriptAlias /cgi-bin/ "/home/httpd/vhosts/default/cgi-bin/"
        <IfModule mod_ssl.c>
                SSLEngine off
        </IfModule>
        <Directory "/home/httpd/vhosts/default/cgi-bin/">
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all
        </Directory>
        <Directory /home/httpd/vhosts/default/htdocs>
        <IfModule sapi_apache2.c>
                php_admin_flag engine on
                php_admin_value open_basedir "/home/httpd/vhosts/default/htdocs:/tmp"
        </IfModule>
        </Directory>
</VirtualHost>
 [2005-02-07 01:04 UTC] rasmus@php.net
No, that ifModule Apache check has nothing to do with the actual filename of the original source file for a module.  It has to do with the LoadModule line you used to load PHP.  If you have:

LoadModule php5_module /some/path/libphp5.so

Then to check for the presence you use IfModule mod_php5.c.  The .c part is a bit odd, but that's just the way Apache works and has nothing to do with PHP.  You can't just make up your own thing here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 15:01:29 2024 UTC