Warning message: A non well formed numeric value encountered
-
Hi,
I’ll keep getting these warning messages:
[03-Mar-2017 11:37:10 UTC] PHP Notice: A non well formed numeric value encountered in /data03/virt55765/domeenid/www.MyDomain.fi/htdocs2/wp-content/plugins/better-wp-security/core/class-itsec-lib.php on line 672
[03-Mar-2017 11:37:10 UTC] PHP Notice: A non well formed numeric value encountered in /data03/virt55765/domeenid/www.MyDomaina.fi/htdocs2/wp-content/plugins/better-wp-security/core/class-itsec-lib.php on line 686Is there anything, I could do?
Pekka
-
Hi,
yes I am using 7.1.1.
PHP Memory limit is 2024M
Pekka
As a workaround change the 2024M (shorthand notation) value into a true integer 2122317824 (bytes) in the php.ini and then retry.
Or formulated differently, don’t use shorthand notation for memory_limit in the php.ini file.It seems as of PHP 7.1.x a value like 2024M is treated as a string.
So you cannot use it for calculations.The iTSec plugin set_minimum_memory_limit() function needs to be adapted to take this into account.
On second thought, the workaround will only fix 1 of the 2 PHP notices …
Thanks, actually in the PHP.ini -file there is given these values:
; Resource Limits
memory_limit = 512M
max_input_time = 60
max_execution_time = 30
max_input_vars = 20000However, when I used BWS-plugin for checking the system status, I got these values:
Environment
Operating System Linux
Server Apache / ZoneOS
Memory usage 16.77 Mb
MYSQL Version 10.1.21-MariaDB
SQL Mode NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
PHP Version 7.1.1
PHP Safe Mode Off
PHP Allow URL fopen On
PHP Memory Limit 2024M
PHP Max Upload Size 2047M
PHP Max Post Size 2047M
PHP Max Script Execute Time 30000
PHP Exif support Yes ( V1.4 )
PHP IPTC support Yes
PHP XML support YesI was not able to edit the php.ini file so I asked help from the SP (Zone)
Pekka
What version of the “BWS-plugin” (Better WP Security ?) are you using ?
BWS stands here for BESTWEBSOFT PANEL ??
But the version of the Better WordPress Security plugin is 6.1.1
-
This reply was modified 8 years ago by
makiaho.
Ah ok.
2024M seems a bit like a strange value … (2048M makes more sense to me).
Anyway the memory limit can be set in many different places:– WP_MAX_MEMORY_LIMIT constant in wp-config.php file.
– .htaccess file.
– Other plugin code …Thanks, I’ll try to set that limit somewhere else. So is the problem (only) that somewhere(?) it is used a string (like 2024M) instead of integer and it cannot be parsed?
Pekka
Hi,
this is a bit weird.
I am not able to modify nor remove the php.ini dedicated for that URL. However, SP (Zone) told that I am able to override it by creating a global php.ini.Now there is the original php.ini with a line
memory_limit = 512Mand the ‘global’ php.ini with a line
memory_limit = 512000000The error exists. When I use BWS-plugin for checking the status, I’ll get these values: PHP Memory Limit 2024M
And also a lot of warnings “Warning: Illegal string offset ‘WP Refresh’ in /data03/virt55765/domeenid/www.MySite.fi/htdocs2/wp-content/plugins/captcha/bws_menu/bws_menu.php on line 216”
The line 216 is$system_info[‘active_plugins’][ $plugin[‘Name’] ] = $plugin[‘Version’]; //LINE 216
I also added a new plugin: Simple System Status and it gives me a bit different values: see the bold concerning on this.
### Begin Simple System Status ###
WP Version: 4.7.2
WP_DEBUG: Enabled
WP Language: fi_FI
Multisite: No
WP Memory Limit: 128MB
WP Memory Limit Status:
<b>Notice</b>: A non well formed numeric value encountered in <b>/data03/virt55765/domeenid/www.MySite.fi/htdocs2/wp-content/plugins/simple-system-status/views/output.php</b> on line <b>80</b>
Not OK – Recommended Memory Limit is 64MBSo is the problem (only) that somewhere(?) it is used a string (like 2024M) instead of integer and it cannot be parsed?
Yes. The set_minimum_memory_limit() function in the core/class-itsec-lib.php file generates the 2 notices on the following lines (when using M shorthand notation):
$memory_limit *= 1048576; $new_memory_limit *= 1048576;
In PHP version < 7.1.x multiplying by eg ‘256M’ was not generating a notice.
Changing the value set for memory_limit to bytes prevents the first notice.
But it does not prevent the second notice.To prevent the second notice from happening you would also need to change the call being made to the set_minimum_memory_limit() function in the iTSec plugin code.
It’s only used in 2 locations. For creating Database Backups and for File Change Detection scans.
The original call looks like this:
set_minimum_memory_limit( '256M' );
And it should be modified to:
set_minimum_memory_limit( 268435456 ); //=256 megabytes in bytes
However there is no point in changing plugin code as any changes will be undone after the next iTSec plugin update.
PHP Memory Limit 2024M (Probably the value of PHP memory_limit. But I did not check the code.)
WP Memory Limit: 128MB (Downloaded the SSS plugin and checked the code. Turns out this is reporting the value from the WordPress WP_MEMORY_LIMIT constant, which is something different).
So this explains the different values. And therefor these 2 values cannot be compared.
Create a simple PHP script (show-mlimit.php) and run it(https://www.yourdomain.com/show-mlimit.php):
<?php echo ini_get('memory_limit'); ?>
This will tell you exactly the current value of memory_limit set by the PHP config.
Any other value displayed in BWS plugin output is probably set somewhere in the WordPress env.Hi,
this is a bit weird.
I am not able to modify nor remove the php.ini dedicated for that URL. However, SP (Zone) told that I am able to override it by creating a global php.ini.Now there is the original php.ini with a line
memory_limit = 512Mand the ‘global’ php.ini with a line
memory_limit = 512000000The error exists. When I use BWS-plugin for checking the status, I’ll get these values: PHP Memory Limit 2024M
And also a lot of warnings “Warning: Illegal string offset ‘WP Refresh’ in /data03/virt55765/domeenid/www.MySite.fi/htdocs2/wp-content/plugins/captcha/bws_menu/bws_menu.php on line 216”
The line 216 is on
`$system_info[‘system_info’] = array(
__( ‘Operating System’, ‘bestwebsoft’ ) => PHP_OS,
__( ‘Server’, ‘bestwebsoft’ ) => $_SERVER[“SERVER_SOFTWARE”],
__( ‘Memory usage’, ‘bestwebsoft’ ) => $memory_usage,
__( ‘MYSQL Version’, ‘bestwebsoft’ ) => $wpdb->get_var( “SELECT VERSION() AS version” ),
__( ‘SQL Mode’, ‘bestwebsoft’ ) => $sql_mode,
__( ‘PHP Version’, ‘bestwebsoft’ ) => PHP_VERSION,
__( ‘PHP Safe Mode’, ‘bestwebsoft’ ) => $safe_mode,
__( ‘PHP Allow URL fopen’, ‘bestwebsoft’ ) => $allow_url_fopen,
__( ‘PHP Memory Limit’, ‘bestwebsoft’ ) => $memory_limit,
__( ‘PHP Max Upload Size’, ‘bestwebsoft’ ) => $upload_max_filesize,
__( ‘PHP Max Post Size’, ‘bestwebsoft’ ) => $post_max_size,
__( ‘PHP Max Script Execute Time’, ‘bestwebsoft’ ) => $max_execution_time,
__( ‘PHP Exif support’, ‘bestwebsoft’ ) => $exif_read_data,
__( ‘PHP IPTC support’, ‘bestwebsoft’ ) => $iptcparse,
__( ‘PHP XML support’, ‘bestwebsoft’ ) => $xml_parser_create,
__( ‘Site URL’, ‘bestwebsoft’ ) => get_option( ‘siteurl’ ),
__( ‘Home URL’, ‘bestwebsoft’ ) => home_url(),
‘$_SERVER[HTTP_HOST]’ => $_SERVER[‘HTTP_HOST’],
‘$_SERVER[SERVER_NAME]’ => $_SERVER[‘SERVER_NAME’],
__( ‘WordPress Version’, ‘bestwebsoft’ ) => $wp_version,
__( ‘WordPress DB Version’, ‘bestwebsoft’ ) => get_option( ‘db_version’ ),
__( ‘Multisite’, ‘bestwebsoft’ ) => $multisite,
__( ‘Active Theme’, ‘bestwebsoft’ ) => $theme[‘Name’] . ‘ ‘ . $theme[‘Version’]
);foreach ( $all_plugins as $path => $plugin ) {
if ( is_plugin_active( $path ) )
$system_info[‘active_plugins’][ $plugin[‘Name’] ] = $plugin[‘Version’]; //LINE 216else
$system_info[‘inactive_plugins’][ $plugin[‘Name’] ] = $plugin[‘Version’];
}I also added a new plugin: Simle System Status and it gives me a bit different values: see the bold concerning on this.
### Begin Simple System Status ###
WP Version: 4.7.2
WP_DEBUG: Enabled
WP Language: fi_FI
Multisite: No
WP Memory Limit: 128MB
WP Memory Limit Status: <br />
<b>Notice</b>: A non well formed numeric value encountered in <b>/data03/virt55765/domeenid/www.MySite.fi/htdocs2/wp-content/plugins/simple-system-status/views/output.php</b> on line <b>80</b><br />
Not OK – Recommended Memory Limit is 64MBTheme Name: twentythirteen-child
Theme Version: 2.1
Theme Author: the WordPress team
Theme Author URI: https://www.ads-software.com/
Is Child Theme: Yes
Parent Theme: Twenty Thirteen
Parent Theme Version: 2.1
Parent Theme URI: https://www.ads-software.com/themes/twentythirteen/
Parent Theme Author URI: https://fi.www.ads-software.com/## Plugins Information ##
— Must-Use Plugins
— WordPress Active Plugins
Captcha by BestWebSoft: 4.2.8 BestWebSoft https://bestwebsoft.com/products/wordpress/plugins/captcha/
Comment Guestbook: 0.7.3 mibuthu https://www.ads-software.com/extend/plugins/comment-guestbook/
Debug: 1.7 SoniNow Team
Duplicator: 1.1.34 Snap Creek https://www.lifeinthegrid.com/duplicator/
Dynamic Widgets: 1.5.12 Qurl https://dynamic-widgets.com/
iThemes Security: 6.1.1 iThemes https://ithemes.com/security
LoginPress – Customizing the WordPress Login: 1.0.11 WPBrigade https://www.WPBrigade.com/wordpress/plugins/loginpress/
MailChimp Forms by MailMunch: 2.1.7 MailMunch https://connect.mailchimp.com/integrations/mailmunch-email-list-builder
MailPoet Newsletters: 2.7.8 MailPoet https://www.mailpoet.com/
PayPal for WooCommerce: 1.3.3 Angell EYE https://www.angelleye.com/product/paypal-for-woocommerce-plugin/
Quttera Web Malware Scanner: 3.0.6.57 Quttera team https://quttera.com
Redirection: 2.5 John Godley https://urbangiraffe.com/plugins/redirection/
Simple System Status: 1.0.0 Leo Gopal https://leogopal.com/
UpdraftPlus – Backup/Restore: 1.12.35 UpdraftPlus.Com, DavidAnderson https://updraftplus.com
WooCommerce: 2.6.14 WooThemes https://woocommerce.com/
WooCommerce Frontend Shop Manager – Free Version: 1.0.3 Mihajlovic Nenad https://www.mihajlovicnenad.com/woocommerce-frontend-shop-manager
WooCommerce Helper: 1.7.2 WooCommerce https://woocommerce.com/products/
WooCommerce Memberships: 1.7.5 WooThemes / SkyVerge https://www.woothemes.com/products/woocommerce-memberships/
WooCommerce PDF Invoices & Packing Slips: 1.5.39 Ewout Fernhout https://www.wpovernight.com
WPForms Lite: 1.3.5 WPForms https://wpforms.com
WP Refresh: 1.1.0 Fred Heusschen https://wprefresh.frebsite.nl
WP Statistics: 12.0 Greg Ross & Mostafa Soufi https://wp-statistics.com/## Server Environment ##
Server Info: Apache / ZoneOS
Host: DBH: d55735.mysql.zonevs.eu, SRV: testi.omanelamaniluoja.fi
Default Timezone: UTC
MySQL Version: 5.5.5-10.1.21-MariaDB— PHP Configuration
PHP Version: 7.1.1
PHP Post Max Size: 2047M
PHP Time Limit: 30000
PHP Max Input Vars: 20000
PHP Safe Mode: No
PHP Memory Limit: 2024M
PHP Upload Max Size: 2047M
PHP Upload Max Filesize: 2047M
PHP Arg Separator: &
PHP Allow URL File Open: Yes— PHP Extentions
DISPLAY ERRORS: On (1)
FSOCKOPEN: Your server supports fsockopen.
cURL: Your server supports cURL.
SOAP Client: Your server has the SOAP Client enabled.
SUHOSIN: Your server does not have SUHOSIN installed.— Session Configuration
Session: Disabled
Session Name: PHPSESSID
Cookie Path: /
Save Path: /data03/virt55765/tmp
Use Cookies: On
Use Only Cookies: OnDeactivate and delete the Simple System Status plugin.
You don’t need it and it is preventing us from focusing on your main issue.I removed Simple System Satus plugin and created the script:
“<?php
echo ini_get(‘memory_limit’);
?>”The value given by the script is 512000000
Pekka
-
This reply was modified 8 years ago by
- The topic ‘Warning message: A non well formed numeric value encountered’ is closed to new replies.