Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 28. Mar 2024, 11:25

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
PostPosted: 5. Feb 2017, 20:48 
Offline

Joined: 26. Dec 2016, 16:58
Posts: 8
After switching from HTTP to HTTPS I keep getting this error message in the debug file:
Code:
02.05.2017 18:25:26 (en) - ERROR 8 in /httpd.www/twg/inc/filefunctions.inc.php, line 2956: A non well formed numeric value encountered

I've even removed all galleries and cleared the cache - but still this error keeps popping up

_________________
{ö} Erik -- https://gallery.e-bachmann.dk


Last edited by Erik Bachmann on 9. Feb 2017, 18:14, edited 1 time in total.

Top
 Profile  
 
PostPosted: 5. Feb 2017, 23:20 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Can you post the line - because line numbers always depends on the version And I don't know which one you use...

In the latest version here some server variables like memory_limit are read. I don't see why https should be a problem.
If this is really the line you have some server configs that should not be that way ;).

Best, Michi


Top
 Profile  
 
PostPosted: 6. Feb 2017, 00:08 
Offline

Joined: 26. Dec 2016, 16:58
Posts: 8
OK - what should I look for??

_________________
{ö} Erik -- https://gallery.e-bachmann.dk


Top
 Profile  
 
PostPosted: 6. Feb 2017, 21:07 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Please see my last post - first line.

Best, Michael


Top
 Profile  
 
PostPosted: 7. Feb 2017, 06:33 
Offline

Joined: 26. Dec 2016, 16:58
Posts: 8
Code:
function return_kbytes($val)
{
    if ($val) {
        $val = trim($val);
        $last = strtolower($val{strlen($val) - 1});
        switch ($last) {
            case 'g':
                $val *= 1024;
            case 'm':
                $val *= 1024;   // 2956: This line tricks the error
            case 'k':
                $val *= 1;
        }
    }
    return $val;
}

_________________
{ö} Erik -- https://gallery.e-bachmann.dk


Top
 Profile  
 
PostPosted: 7. Feb 2017, 08:07 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Then please check your php server settings.

There e.g. memory-limit has 500mb instead of 500m
In the administration you can see the php info on the info page.

Best Michael


Top
 Profile  
 
PostPosted: 8. Feb 2017, 22:19 
Offline

Joined: 26. Dec 2016, 16:58
Posts: 8
The memory limit is 536870912. And PHP version 7.1
Quote:
info.php reports: - Memory limit Very Good (536870912)

I'm not quite sure, where this takes me..??

_________________
{ö} Erik -- https://gallery.e-bachmann.dk


Top
 Profile  
 
PostPosted: 8. Feb 2017, 23:53 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
The function that reports an error tells you that the value that should be parsed is not a number. The fuction does remove from e.g. 500m the m - so 500 is the value.
On your server something like 500mb I think is defined. So you have to find the value that is entered in an incorrect.

On the info page is also a button php info which shows all the values. Chck this and look for invalid entries there. This is not a TWG issue. This is a server configuration issue.

Best, Michael


Top
 Profile  
 
PostPosted: 9. Feb 2017, 14:04 
Offline

Joined: 26. Dec 2016, 16:58
Posts: 8
Close - but no cigar (yet!) 8)
Good old fasion searching:
Code:
find . -name "*.php" -exec grep -n -H "return_kbytes" {} ;

lead me to check the values of:
Quote:
upload_max_filesize 96M
post_max_size 96M
memory_limit 536870912

The processed value is "96M" - a string.

In PHP 7.1 a type casting is needed:
Code:
function return_kbytes($val)
{
    if ($val) {
        $val = trim($val);   //$ val is a string
        $last = strtolower($val{strlen($val) - 1});
        $val = (int)$val;   //2017-02-09/EBP: Type casting bugfix
        switch ($last) {
            case 'g':
                $val *= 1024;
            case 'm':
                $val *= 1024;   // A string was multiplied with a number
            case 'k':
                $val *= 1;
        }
    }
    return $val;
}

Same problem has been seen in Joombla: https://github.com/joomla/joomla-cms/pull/12311 :mrgreen:

_________________
{ö} Erik -- https://gallery.e-bachmann.dk


Top
 Profile  
 
PostPosted: 9. Feb 2017, 16:22 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
is php 7 now so picky.

So it is solved now?

Because then i'll add this to the next release.


Top
 Profile  
 
PostPosted: 9. Feb 2017, 17:46 
Offline

Joined: 26. Dec 2016, 16:58
Posts: 8
Works smoothly!
How do I close this topic?

_________________
{ö} Erik -- https://gallery.e-bachmann.dk


Top
 Profile  
 
PostPosted: 9. Feb 2017, 17:52 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
This version of the forum does not have something like this. You can add [solved] to the title if you like.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy