PHP log errors from config.php settings in hosting beta

The following settings in wp-config.php

This is a safety switch for plugin code snippets

define(‘CODE_SNIPPETS_SAFE_MODE’, false);

This is something I have in all my sites with several other similiar settings used for multidoamin setups. This is also recommended to solve a problem with CDN Cloudflare and plugins like your "multisite privacy'

if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {

$_SERVER['HTTPS']='on';

}

Checking hosting log I see these errors.

The following errors in php log

[18-Dec-2018 16:17:27 UTC] PHP Warning: Use of undefined constant ‘CODE_SNIPPETS_SAFE_MODE’ – assumed '‘CODE_SNIPPETS_SAFE_MODE’' (this will throw an Error in a future version of PHP) in /var/web/site/public_html/wp-config.php on line 4

[18-Dec-2018 16:13:27 UTC] PHP Warning: Use of undefined constant ON – assumed 'ON' (this will throw an Error in a future version of PHP) in /var/web/site/public_html/wp-config.php on line 100

[18-Dec-2018 16:13:27 UTC] PHP Warning: Use of undefined constant ‘HTTPS’ – assumed '‘HTTPS’' (this will throw an Error in a future version of PHP) in /var/web/site/public_html/wp-config.php on line 100

[18-Dec-2018 16:13:27 UTC] PHP Warning: Use of undefined constant ON – assumed 'ON' (this will throw an Error in a future version of PHP) in /var/web/site/public_html/wp-config.php on line 100

[18-Dec-2018 16:13:27 UTC] PHP Warning: Use of undefined constant ‘HTTPS’ – assumed '‘HTTPS’' (this will throw an Error in a future version of PHP) in /var/web/site/public_html/wp-config.php on line 100

  • Ash
    • Code Norris

    Hello Lee

    Did you copy the code from somewhere and pasted it in wp-config.php file? Because it seems the issue is single quote character you used there.

    So as a try, would you please delete the single quote and type it yourself for every define and code you added?

    If that’s not the issue, would you please put your wp-config.php file in http://pastebin.com and send me the link? MAKE SURE you remove the DB information before you save in pastebin.

    Have a nice day!

    Cheers,

    Ash

  • Lee
    • Syntax Hero

    No it is not the quote 8 have single quotes in other sites. Also I changed them and got the same warnings.

    I think maybe the hosting beta is scanning for non standard wp-config.php files and reporting warnings. Could you check to see if there are any limits before we go down the trouble shooting path of syntax?

    Thanks

  • Ash
    • Code Norris

    Hello Lee

    There is no such limitation in the hosting that you can’t use non-standard wp config or other files. You can keep your defines in any file and include it, that’s not a problem.

    Now, let’s look at the warning:

    PHP Warning: Use of undefined constant ‘CODE_SNIPPETS_SAFE_MODE’ – assumed ‘‘CODE_SNIPPETS_SAFE_MODE’’ (this will throw an Error in a future version of PHP)

    It says CODE_SNIPPETS_SAFE_MODE is undefined and it is assuming it as ‘‘CODE_SNIPPETS_SAFE_MODE’’ – notice it added a quote around that. That made me thinking the issue with the quote.

    So, would you please send me your full config file wiping the db info, using http://pastebin.com and I will use the same file on my site? So let me know.

    Have a nice day!

    Cheers,

    Ash