Welcome Guest, Not a member yet? Register   Sign In
I need help understanding this error ci 4.3.7
#1

Fatal error: Uncaught TypeError: Return value of CodeIgniter\HTTP\IncomingRequest::getPostMaxSize() must be of the type int, float returned in C:\laragon\www\framework\system\HTTP\IncomingRequest.php:203 Stack trace: #0 C:\laragon\www\framework\system\HTTP\IncomingRequest.php(164): CodeIgniter\HTTP\IncomingRequest->getPostMaxSize() #1 C:\laragon\www\framework\system\Config\Services.php(549): CodeIgniter\HTTP\IncomingRequest->__construct(Object(Config\App), Object(CodeIgniter\HTTP\URI), 'php://input', Object(CodeIgniter\HTTP\UserAgent)) #2 C:\laragon\www\framework\system\Config\Services.php(505): CodeIgniter\Config\Services::incomingrequest(Object(Config\App), false) #3 C:\laragon\www\framework\system\Config\BaseService.php(252): CodeIgniter\Config\Services::request(NULL, false) #4 C:\laragon\www\framework\system\Config\BaseService.php(193): CodeIgniter\Config\BaseService::__callStatic('request', Array) #5 C:\laragon\www\framework\system\Config\Services.php(501): CodeIgniter\Config\BaseService::getSharedInstance('request', in C:\laragon\www\framework\system\HTTP\IncomingRequest.php on line 203
Reply
#2

Is getPostMaxSize() a CodeIgniter method or are you connecting to or using Laravel in your project too?
Reply
#3

I use codeigniter 4.3.7 alone php 7.4.15
Reply
#4

Can you check and post the post_max_size in your php.ini?
Reply
#5

Thank you for converting the value

post_max_size=0. it works well.
Or
post_max_size=8M. it works well.
But
post_max_size=2G. do not work.
Reply
#6

Perhaps it's a bug. You can set the value to 2048M for now, if that works.
Reply
#7

Post_max_size = 0 no limit
Reply
#8

(This post was last modified: 08-01-2023, 07:08 PM by kenjis.)

Your server OS seems to be 32 bit.

The maximum number of int in PHP is 2,147,483,647.
See PHP_INT_MAX in https://www.php.net/manual/en/reserved.constants.php

2GB is 214,783,648 bytes.
Reply
#9

Note:

PHP allows shortcuts for byte values, including K (kilo), M (mega) and G (giga). PHP will do the conversions automatically
if you use any of these. Be careful not to exceed the 32 bit signed integer limit (if you're using 32bit versions) as it will
cause your script to fail.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB