You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "J. Bakshi" <jo...@infoservices.in> on 2009/03/03 06:57:50 UTC

[users@httpd] Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

Dear list,

I like to suppress the error messages from my live site. That's why I
have added the following in my .htaccess

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

But after putting these lines My site gives 500 internal server error.
If I comment these lines then everything is OK. I have checked the log
during the 500 error and it shows

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Invalid command 'php_flag', perhaps mis-spelled or defined by a module
not included in the server configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Is there any misconfiguration in the syntax I have put there ?

Please suggest.
Thanks

---------------------------------------------------------------------
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] Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

Posted by "J. Bakshi" <jo...@infoservices.in>.
Krist van Besien wrote:
> On Tue, Mar 3, 2009 at 12:56 PM, J. Bakshi <jo...@infoservices.in> wrote:
>
>   
>> May be , I'm not sure but I am happy to confirm that I have solved it in
>> a different way. At my web root directory I have created php.ini and
>> placed the configuration as
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> display_startup_errors = off
>> display_errors = off
>> html_errors = off
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> And now it is working :-)
>>     
>
> It works for an obvious reason: php.ini is something completely
> separate from httpd.conf. You can't just mix php.ini statements in
> your apache config.
>
> Krist
>   

I  admit.  Actually my webspace is controlled by cpanel and php is not
working as a module. I have found in google that where php is not a
apache module .htaccess can't control php values. The solution is
placing a php.ini in the web root directory with php specific setting.

Thanks


---------------------------------------------------------------------
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] Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

Posted by Krist van Besien <kr...@gmail.com>.
On Tue, Mar 3, 2009 at 12:56 PM, J. Bakshi <jo...@infoservices.in> wrote:

>
> May be , I'm not sure but I am happy to confirm that I have solved it in
> a different way. At my web root directory I have created php.ini and
> placed the configuration as
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> display_startup_errors = off
> display_errors = off
> html_errors = off
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> And now it is working :-)

It works for an obvious reason: php.ini is something completely
separate from httpd.conf. You can't just mix php.ini statements in
your apache config.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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] Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

Posted by "J. Bakshi" <jo...@infoservices.in>.
Eric Covener wrote:
> On Tue, Mar 3, 2009 at 12:57 AM, J. Bakshi <jo...@infoservices.in> wrote:
>
>   
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> Invalid command 'php_flag', perhaps mis-spelled or defined by a module
>> not included in the server configuration
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>     
>
> It's a mod_php directive. Maybe you're not using mod_php?
>   

May be , I'm not sure but I am happy to confirm that I have solved it in
a different way. At my web root directory I have created php.ini and
placed the configuration as

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display_startup_errors = off
display_errors = off
html_errors = off
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And now it is working :-)

Thanks


>
>   


---------------------------------------------------------------------
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] Invalid command 'php_flag', perhaps mis-spelled or defined by a module not included in the server configuration

Posted by Eric Covener <co...@gmail.com>.
On Tue, Mar 3, 2009 at 12:57 AM, J. Bakshi <jo...@infoservices.in> wrote:

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Invalid command 'php_flag', perhaps mis-spelled or defined by a module
> not included in the server configuration
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It's a mod_php directive. Maybe you're not using mod_php?


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
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