Title: PHP Deprecation Error
Last modified: December 29, 2024

---

# PHP Deprecation Error

 *  [mmubashar](https://wordpress.org/support/users/mmubashar/)
 * (@mmubashar)
 * [1 year, 4 months ago](https://wordpress.org/support/topic/php-deprecation-error/)
 * Hello,
 * I’m getting this error in the debug logs. I’m assuming its incompatibility with
   PHP8.x?
 *     ```wp-block-code
        * PHP Warning:  Undefined array key "SCRIPT_FILENAME" in /home/xxx/public_html/assets/plugins/better-wp-security/core/modules/hide-backend/class-itsec-hide-backend.php on line 95 * PHP Deprecated:  substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/xxx/public_html/assets/plugins/better-wp-security/core/modules/hide-backend/class-itsec-hide-backend.php on line 95
       ```
   

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

 *  Plugin Support [chandelierrr](https://wordpress.org/support/users/shanedelierrr/)
 * (@shanedelierrr)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/php-deprecation-error/#post-18235010)
 * Hi [@mmubashar](https://wordpress.org/support/users/mmubashar/),
 * Glad you reached out!
 * Could you please share which PHP version and plugin version you’re using? I’d
   like to replicate this on a test site, so that I can create an internal tracking
   report for this.
 * If you have additional replication steps to trigger those errors, please share
   it here, too.
 * Looking forward to your response.
 *  Thread Starter [mmubashar](https://wordpress.org/support/users/mmubashar/)
 * (@mmubashar)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/php-deprecation-error/#post-18238902)
 * Hi there,
 * I’m using PHP 8.1.3 with plugin version 9.3.6
 * It seems to be happening on every page reload, thrown in the WP_Debug
 *  [nlpro](https://wordpress.org/support/users/nlpro/)
 * (@nlpro)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/php-deprecation-error/#post-18239078)
 * Hi [@mmubashar](https://wordpress.org/support/users/mmubashar/),
 * If for whatever reason the web server/PHP does not add the **SCRIPT_FILENAME**
   entry to the PHP **$_SERVER** global variable (or it is programmatically removed)
   AND the SolSec plugin **Hide Backend** module is enabled, this PHP warning will
   occur on every request.
 * As a test please create a new .php file (my_phpinfo.php) with the following contents:
 *     ```wp-block-code
       <?phpphpinfo( INFO_VARIABLES );?>
       ```
   
 * Then upload it to the root folder of the WordPress install and simply run it:
 * [https://www.yourdomain.com/my_phpinfo.php](https://www.yourdomain.com/my_phpinfo.php).
 * Finally check for the **$_SERVER[‘SCRIPT_FILENAME’]** entry in the resulting 
   output.
 * If the entry exists there is always the possibility that it is programmatically
   removed by some plugin (or custom) code.
 * If this is the case temporarily disabling all other plugins (and custom code)
   should fix the PHP warning.
 * Don’t forget to remove the my_phpinfo.php test file afterwards 😉
 *  Thread Starter [mmubashar](https://wordpress.org/support/users/mmubashar/)
 * (@mmubashar)
 * [1 year, 3 months ago](https://wordpress.org/support/topic/php-deprecation-error/#post-18249315)
 * [@nlpro](https://wordpress.org/support/users/nlpro/) Yes, it does show indeed
   in the phpinfo. So it’s safe to say this is being removed by some plugin? I’ll
   disable plugins and see which one is being the bad boy. Thanks a lot

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

The topic ‘PHP Deprecation Error’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=2980272)
 * [Solid 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/)

 * 4 replies
 * 3 participants
 * Last reply from: [mmubashar](https://wordpress.org/support/users/mmubashar/)
 * Last activity: [1 year, 3 months ago](https://wordpress.org/support/topic/php-deprecation-error/#post-18249315)
 * Status: not resolved