wplib-box
wplib-box copied to clipboard
Apache container does not recognize `php_value` in .htaccess
On a Apache container issue, I am getting the following error in the Apache logs:
[Mon Jul 22 23:37:17.845081 2019] [core:alert] [pid 7:tid 140033393052392] [client 172.42.0.1:56708] /var/www/localhost/htdocs/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
This is because .htaccess has the following command in it:
php_value short_open_tag 0
I absolutely can work around this, so it is not a critical issue, but it is a common thing that might appear in an .htaccess file so it would be nice to figure out why it does not recognize it and fix it.
This is a bit of a guess but I think php_value is only used for directives that take a value rather than a boolean.
Try php_flag instead. See this for more info:
https://www.php.net/manual/en/configuration.changes.php
On Mon, Jul 22, 2019, 7:46 PM Mike Schinkel [email protected] wrote:
On a Apache container issue, I am getting the following error in the Apache logs:
[Mon Jul 22 23:37:17.845081 2019] [core:alert] [pid 7:tid 140033393052392] [client 172.42.0.1:56708] /var/www/localhost/htdocs/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
This is because .htaccess has the following command in it:
php_value short_open_tag 0
I absolutely can work around this, so it is not a critical issue, but it is a common thing that might appear in an .htaccess file so it would be nice to figure out why it does not recognize it and fix it.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wplib/wplib-box/issues/583?email_source=notifications&email_token=AAAYNC5T6KUBCIL7ZGRNZA3QAZBGVA5CNFSM4IF6ENUKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HAZBGGQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAYNC6GZDRCKWHGRQ6XJODQAZBGVANCNFSM4IF6ENUA .
@tedmasterweb Thanks for the follow up! That code in .htaccess came from client code that I can't (yet) update, so I think probably their hosting is ignoring it somehow.
It is ignoring it because it is the wrong directive. It should be php_flag and not php_value. Make sense or am I missing something?
@tedmasterweb Makes total sense, and thanks for bringing this up and keeping me from chasing my tail on this one. I should have said that before.
What's confusing me is why it is not causing failure for others, but that is of course not relevant to WPLib Box.