php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10241 php_flag dosn't work in httpd.conf, but it works in .htaccess files
Submitted: 2001-04-09 08:45 UTC Modified: 2001-05-06 12:30 UTC
From: vl at ez dot no Assigned:
Status: Closed Package: PHP options/info functions
PHP Version: 4.0.4pl1 OS: linux
Private report: No CVE-ID: None
 [2001-04-09 08:45 UTC] vl at ez dot no
Hi

Maybe I have missunderstud something but I thought that
directives like php_value, php_flag, php_admin_value and 
php_admin_flag may be used in httpd.conf. This doesn't 
seem to be the case with php4.0.4pl1. I have tried it both 
in global, VirtualHost and in a directory section. It 
always cause this error message:
# httpd -t
Syntax error on line 1196 of /etc/httpd/conf/httpd.conf:
Invalid command 'php_flag', perhaps mis-spelled or defined 
by a module not included in the server configuration

I have php4 installed for sure....

Then I tried to put the statment in a .htaccess   
filephp_flag magic_quotes_gpc off
Then it worked

System is apache 1.3.14, php-4.0.4pl1, redhat6.2 and 
redhat7.0
./configure  --enable-ftp --with-xml --with-dom 
--enable-trans-sid --with-config-file-path=/etc/httpd 
--with-mysql --with-magic-quotes --with-apxs --with-ttf 
--with-qtdom --with-pgsql --with-gd --with-imap 
--includedir=/usr --with-openssl=/usr --enable-shmop 
--enable-sysvsem

Best regards
Vidar

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-09 12:52 UTC] ohrn@php.net
This actually bit me yesterday.

It seems that Apache hasn't retrived the new options from dynamically loaded modules at the time it parses the config file.

Upgrading to Apache 1.3.19 solved it for me. Also make sure to place the php options after the LoadModule&AddModule directives in your config file.

Please report if this solves your problem.
 [2001-04-11 03:22 UTC] vl at ez dot no
Hi

Yes, I do have the php options after
the LoadModule&AddModule directives

But I think it is wierd that it doesn't work in apache 
1.3.14. Other modules like mod_rewrite manage to add 
directives that may be used in httpd.conf ("RewriteEngine 
On" is one example)

I'll try to test with 1.3.19 after Easter.

Best regards,
vidar

 [2001-05-06 11:30 UTC] sniper@php.net
one to be fixed before 4.0.6
 [2001-05-06 12:30 UTC] rasmus@php.net
I don't see a PHP fix here.  It is either a user error or an Apache-1.3.14 specific bug.  The php_value, etc. directives certainly work fine in httpf.conf.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 13:01:30 2024 UTC