[SOLVED] A non well formed numeric value ?? (PHP7?)

6 years 5 months ago - 6 years 5 months ago #298918 by mikerotec
Now seeing thousands and thousands of notices in the php error logs - just since PHP7 upgrade, I believe...

A non well formed numeric value encountered in /var/www/html/ourweb/html/components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.sysplug.php on line 25

is there a quick fix?

Please Log in to join the conversation.

6 years 5 months ago #298933 by krileon
Replied by krileon on topic A non well formed numeric value ?? (PHP7?)
It's a known issue from your own topic below.

www.joomlapolis.com/forum/153-professional-member-support/237493-cbsubs-php-notice-non-well-formed-numeric-value#297772

Quickfix as follows.

IN: components/com_comprofiler/plugin/user/plug_cbpaidsubscriptions/cbpaidsubscriptions.sysplug.php
ON: Line 20 - 21
FROM:
	$last			=	strtolower( $memMax{strlen( $memMax ) - 1} );
	$memMax			=	substr( $memMax, 0, -1 );
TO:
	$last			=	strtolower( substr( $memMax, -1 ) );
	$memMax			=	(int) $memMax;

It's however just a notice and won't hurt anything. Folks, don't obsess over a servers error log. It doesn't matter if its filled with billions of notices. They're just notices.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: mikerotec

Please Log in to join the conversation.

6 years 5 months ago #298935 by mikerotec
Replied by mikerotec on topic A non well formed numeric value ?? (PHP7?)
:woohoo: THANKS very much for the quick fix. I thought that I had brought this up before, but the "My Topics" link on this forum came up EMPTY. (Turns out its set to only show "one month" of topics by default...)

Anyway, I beg to differ that they are "just" notices. I have hundreds of thousands of them swelling the log files, and the processing and output of each and every one takes up some of our very finite server resources. CPU is EXPENSIVE, RAM is EVEN MORE EXPENSIVE. We're on a very tight budget here - in case you haven't noticed in your part of the world, the economy has TANKED again, and very noticeably in our market segment.

I have to do everything in my power to make sure that we have clean mean 'not a single electron wasted' code for our website. Constant drivel from mindless Chinese and Ukrainian hackerbots is already sapping our resources, so much so that when three or four of the brainless bots happen to randomly traverse us at the same time as say a MSNsearchbot, it pushes us right into swapfile, rendering our site unresponsive.

Please Log in to join the conversation.

6 years 5 months ago #298939 by krileon
Replied by krileon on topic A non well formed numeric value ?? (PHP7?)
You shouldn't be logging or outputting notices on a production environment. Only bother with those on a development environment. They have little to no performance cost when it comes to the interpreter (PHP). In this case it has no cost what so ever as it's just complaining that a math operation is being ran on an integer with a string in it (e.g. 100m * 100), which previously (before PHP 7) was never an issue as the string character would just be ignored. The interpreter logs a notice about this now as it may be unexpected behavior when writing code.

CPU is EXPENSIVE, RAM is EVEN MORE EXPENSIVE

Don't really agree here. If anything hardware is cheaper than ever. I typically stick with using a VPS for hosting as you can reseller it, host multiple isolated installs easily, run private Git repo, etc... For example you can get a VPS with 60GB SSD, 4GB ram, 3000GB bandwidth, and 2 core CPU for $20/mo; that should be more than enough.

I have to do everything in my power to make sure that we have clean mean 'not a single electron wasted' code for our website. Constant drivel from mindless Chinese and Ukrainian hackerbots is already sapping our resources, so much so that when three or four of the brainless bots happen to randomly traverse us at the same time as say a MSNsearchbot, it pushes us right into swapfile, rendering our site unresponsive.

Bot traversal shouldn't be taking down your site unless it's a DDOS. Nor should a log file negatively impact your performance in any way unless it's riddle with errors, which will destroy performance (a notice is not an error; the interpreter did not fail like with an error). You may have some public facing URLs that are causing heavy operations like traversing all your users (e.g. a userlist with hundreds of thousands of users) that could be causing a hangup.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 5 months ago #298964 by krileon
Replied by krileon on topic A non well formed numeric value ?? (PHP7?)
Ok, this is fixed in latest CBSubs build and CB build. There were 2 such issues in CBSubs and 1 in CB. All 3 fixed.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 5 months ago #299097 by mikerotec
Replied by mikerotec on topic A non well formed numeric value ?? (PHP7?)
I see now that I didn't have the latest CBsubs installed (correcting that shortly!).
Is there a way to tell what CB "build" we are on? CB control panel says we're on 'latest version' 2.1.3 but doesn't show a build number...

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.192 seconds

Facebook Twitter LinkedIn