Title: Php error_log
Last modified: June 20, 2024

---

# Php error_log

 *  Resolved [boabo](https://wordpress.org/support/users/boabo/)
 * (@boabo)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/php-error_log-2/)
 * Hello,
 * For your info, i’m getting this php warning error. Thanks
 * Undefined array key “REQUEST_METHOD” in …/wp-content/plugins/better-wp-security/
   core/modules/ssl/class-itsec-ssl.php on line 67

Viewing 11 replies - 1 through 11 (of 11 total)

 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-17841400)
 * Hi [@boabo](https://wordpress.org/support/users/boabo/), glad you reached out!
 * I’d like to replicate this on our end so our team can get this resolved. Can 
   you please provide additional information on your current site environment? –
   WP, PHP, and Solid Security versions
 * Also, can you tell me what actions were made or if plugin settings were updated
   when the error occurred?
 * Looking forward to your response.
 *  Thread Starter [boabo](https://wordpress.org/support/users/boabo/)
 * (@boabo)
 * [1 year, 11 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-17841687)
 * All updated, Wp 6.5.4,php 8.2, Solid security 9.3.3, etc Also runs on litespeed
   and litespeed cache. I discovered it recently only.
 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-17884135)
 * Hi [@boabo](https://wordpress.org/support/users/boabo/),
 * Just wanted to circle back here that I’ve worked on trying to replicate this 
   warning on my test environments, but I could not see it on my logs.
 * Still, I’ve escalated this to our dev team for review and fixing. I’ll get back
   to you when I have news.
 * Thank you for your patience!
 *  [Flick](https://wordpress.org/support/users/felicity_gilbertson/)
 * (@felicity_gilbertson)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18059538)
 * FYI – I’m also getting this error message filling up my logs… Have you ended 
   up managing to replicate this?
    -  This reply was modified 1 year, 8 months ago by [Flick](https://wordpress.org/support/users/felicity_gilbertson/).
    -  This reply was modified 1 year, 8 months ago by [Flick](https://wordpress.org/support/users/felicity_gilbertson/).
 *  Thread Starter [boabo](https://wordpress.org/support/users/boabo/)
 * (@boabo)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18060025)
 * [@felicity_gilbertson](https://wordpress.org/support/users/felicity_gilbertson/)
   No, still getting same error in my public_html/error_log and the file size is
   now close to 0.5MB
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18060213)
 * Hi [@boabo](https://wordpress.org/support/users/boabo/), [@felicity_gilbertson](https://wordpress.org/support/users/felicity_gilbertson/),
 * I’ve had a look at the relevant code (I’ve replaced irrelevant lines of code 
   with …):
 *     ```wp-block-code
       59	if ( is_ssl() ) {		...		...			...		...		...		...67	} elseif ( 'cli' !== php_sapi_name() && ! ITSEC_Core::doing_data_upgrade() && 'GET' === $_SERVER['REQUEST_METHOD'] ) {68		$this->redirect_to_https();69	}
       ```
   
 * It seems to me that the condition at line 67 (as is) may create a conflict. The
   goal of the condition is to exclude command line interface (cli) commands from
   being redirected to https. Which makes sense because a cli command is not an 
   http(s) request. So when a cli command runs there is no point to redirect to 
   https.
 * However, just checking for ‘cli’ !== php_sapi_name() and then assuming it’s a
   http request where $_SERVER[‘REQUEST_METHOD’] exists is prone to error/PHP warning.
   This can easily be avoided:
 *     ```wp-block-code
       67	} elseif ( 'cli' !== php_sapi_name() && ! ITSEC_Core::doing_data_upgrade() && isset( $_SERVER['REQUEST_METHOD'] ) && 'GET' === $_SERVER['REQUEST_METHOD'] ) {
       ```
   
 * As a **test** please make a copy of the /wp-content/plugins/better-wp-security/
   core/modules/ssl/class-itsec-ssl.php file. Then edit the original file (not the
   copy) and change line 67 to match with the above. Then start monitoring whether
   the issue persists (or not).
 * [@shanedelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * Instead of using the PHP [php_sapi_name()](https://www.php.net/manual/en/function.php-sapi-name.php)
   function it’s probably better to check for the WP_CLI constant:
 *     ```wp-block-code
       67	} elseif ( defined( 'WP_CLI' ) && WP_CLI && ... ) {68		...69	}
       ```
   
 * +++ To prevent any confusion, I’m not SolidWP +++
    -  This reply was modified 1 year, 8 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
    -  This reply was modified 1 year, 8 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
    -  This reply was modified 1 year, 8 months ago by [nlpro](https://wordpress.org/support/users/nlpro/).
 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18060591)
 * Hi [@nlpro](https://wordpress.org/support/users/nlpro/), thank you for this insightful
   recommendation!
 * I’ve forwarded them to our dev team for review and I’ll circle back here when
   I have feedback.
 * We greatly appreciate your help!
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18061398)
 * Hi [@shanedelierrr](https://wordpress.org/support/users/shanedelierrr/),
 * Okidoki. Just realized I got the alternative for php_sapi_name() wrong…ahum. 
   Apologies for the confusion.
 * This is better:
 *     ```wp-block-code
       67	} elseif ( ( ! defined( 'WP_CLI' ) || ! WP_CLI ) && ... ) {68		...69	}
       ```
   
 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18061483)
 * Thank you [@nlpro](https://wordpress.org/support/users/nlpro/)! I got your message
   across the team before I’m out of office for today. I’ll keep you posted when
   I have news. Our challenge for this issue is that we don’t see it in any of our
   test (old and new) environments.
   Also, [@boabo](https://wordpress.org/support/users/boabo/)
   [@felicity_gilbertson](https://wordpress.org/support/users/felicity_gilbertson/),
   if you can give the suggestion a try, please let us know if it works on your 
   end.
 *  [Flick](https://wordpress.org/support/users/felicity_gilbertson/)
 * (@felicity_gilbertson)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18062080)
 * That code is in for me and so far the Error_Log is not producing that warning…
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18128600)
 * Hi [@boabo](https://wordpress.org/support/users/boabo/),
 * According to the 9.3.4 Changelog:
 * > Bug Fix: PHP warning in the SSL module on some server setups.
 * Please update the SolSec plugin to the 9.3.4 release and then confirm the issue
   has been fixed in your env. If so, please mark this topic as ‘Resolved’.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Php error_log’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

## Tags

 * [error_log](https://wordpress.org/support/topic-tag/error_log/)

 * 11 replies
 * 4 participants
 * Last reply from: [nlpro](https://wordpress.org/support/users/nlpro/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/php-error_log-2/#post-18128600)
 * Status: resolved