|  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
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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: michael at stellarent dot com
New email:
PHP Version: OS:


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

This does not work:

<IfModule sapi_apache2.c>
 php_admin_flag engine on

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

<IfModule mod_php5.c>
 php_admin_flag engine on

I am compiling from .src.rpm, with:

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.


Add a Patch

Pull Requests

Add a Pull Request


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]
I don't know what the bug is if this works:

<IfModule mod_php5.c>
 php_admin_flag engine on

 [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

<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
        <Directory "/home/httpd/vhosts/default/cgi-bin/">
                AllowOverride None
                Options None
                Order allow,deny
                Allow from all
        <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"
 [2005-02-07 01:04 UTC]
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/

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: Fri Feb 23 18:01:28 2024 UTC