File Upload Error - a non well formed numeric value encountered


#1

Hi all,

on my windows server I get following error at uploading a file (no matter if it´s an image or document).

a non well formed numeric value encountered

I am using the starterkit without any modifications.
On my Mac running MAMP everything is working fine.

Hope anyone can help me.
Thanks!


#2

Can you please provide some more information about your Windows setup (PHP version, server, XAMPP? etc) and your Kirby version? I know there were problems in the past with uploading images on Windows due to some mime type detection problems but I can’t recall having seen this error message before.

Is the image uploaded despite the message?


#3

Hi, thanks for your reply.
I found out the issue. My file size was too big (in my php.ini file I declared 2MB, but the file has 4MB).

Just strange with the error message.
I just took a look in the source code and found out following:

In the file kirby/vendor/getkirby/toolkit/lib/upload.php in line 193 it throws an exception ($messages = $this->messages()).
For me the function messages() looks good, it just returns a normal array with some error messages.
So instead of throwing the error with the correct error message, it throws the message “a non well formed numeric value encountered”.

Maybe it´s windows related?
My server is running with PHP 7.1.5 under FastCGI mode.
Maybe some of you Pro´s can find out why the function is throwing an exception only at windows.

Thanks!
Alex


#4

Yeah, strange, we should to look into this.


#5

Same problem on a friend’s website being hosted on GoDaddy Linux env.

Had to set a bigger upload file limit, problem solved.