*

simon1111

  • **
  • 7 posts
PHP Limit not working
« on: January 30, 2025, 02:41:08 PM »
Hello I get the following error when I try to change the uploa limit on this page
oc-admin/index.php?page=settings&action=media



MY php limit is set correct on server and occlass even shows it as
Maximum size PHP configuration allows: 208896 KB


But OSClass still will not allow me to increase it 

I get this error
You cannot set a maximum file size higher than the one allowed in the PHP configuration: 2048 KB


Please see screen shots



*

MB Themes

Re: PHP Limit not working
« Reply #1 on: January 30, 2025, 06:08:29 PM »
https://docs.osclasspoint.com/settings

Code: [Select]
$max_upload = $this->_sizeToKB(ini_get('upload_max_filesize'));
$max_post = $this->_sizeToKB(ini_get('post_max_size'));
$memory_limit = $this->_sizeToKB(ini_get('memory_limit'));

$upload_mb = min($max_upload, $max_post, $memory_limit);
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

simon1111

  • **
  • 7 posts
Re: PHP Limit not working
« Reply #2 on: January 31, 2025, 12:49:41 AM »
Hello none of this helps me fix the problem

The php setting is fine
see
Maximum size PHP configuration allows: 262144 KB

The software is not reading it correct
see
You cannot set a maximum file size higher than the one allowed in the PHP configuration: 2048 KB

*

MB Themes

Re: PHP Limit not working
« Reply #3 on: January 31, 2025, 03:26:42 PM »
One you see may not be representative for all the limits.
Pretty sure you have not checked all these limits...
you can try to manually change in t_preference table in database, but it may cause problems when you try to upload larger image.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

simon1111

  • **
  • 7 posts
Re: PHP Limit not working
« Reply #4 on: January 31, 2025, 03:29:59 PM »



One you see may not be representative for all the limits.
Pretty sure you have not checked all these limits...
you can try to manually change in t_preference table in database, but it may cause problems when you try to upload larger image.



Hello thank you . Can you please reply with the "exact names" of "all the limits" we need to change in the php settings


*

Wiz

  • ****
  • 162 posts
Re: PHP Limit not working
« Reply #5 on: February 01, 2025, 04:06:24 PM »
As MB Themes said, you need to check your php ini configuration for:

ini_get('upload_max_filesize'): Gets the max file upload size from php.ini.
ini_get('post_max_size'): Gets the max post request size from php.ini.
ini_get('memory_limit'): Gets the memory limit from php.ini.

The value you are seeing is being retrieved from the smallest value of ANY of the above limits/sizes to ensure uploads stay within the safest limit.


*

simon1111

  • **
  • 7 posts
Re: PHP Limit not working
« Reply #6 on: February 02, 2025, 12:51:35 AM »
All those setting are set correctly and we tested uploads of 100 megs on the server yet the software wont allow me to change anything in the admin



As MB Themes said, you need to check your php ini configuration for:

ini_get('upload_max_filesize'): Gets the max file upload size from php.ini.
ini_get('post_max_size'): Gets the max post request size from php.ini.
ini_get('memory_limit'): Gets the memory limit from php.ini.

The value you are seeing is being retrieved from the smallest value of ANY of the above limits/sizes to ensure uploads stay within the safest limit.

*

MB Themes

Re: PHP Limit not working
« Reply #7 on: February 02, 2025, 11:26:01 AM »
Nothing or just size?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

simon1111

  • **
  • 7 posts
Re: PHP Limit not working
« Reply #8 on: February 02, 2025, 02:39:25 PM »
Nothing or just size?


Just the size produces the error
Everything else works perfect


*

Wiz

  • ****
  • 162 posts
Re: PHP Limit not working
« Reply #9 on: February 02, 2025, 04:57:52 PM »
All those setting are set correctly and we tested uploads of 100 megs on the server yet the software wont allow me to change anything in the admin



As MB Themes said, you need to check your php ini configuration for:

ini_get('upload_max_filesize'): Gets the max file upload size from php.ini.
ini_get('post_max_size'): Gets the max post request size from php.ini.
ini_get('memory_limit'): Gets the memory limit from php.ini.

The value you are seeing is being retrieved from the smallest value of ANY of the above limits/sizes to ensure uploads stay within the safest limit.

Works fine here (except when all php limits are set to -1/infinity). I think you might have another issue at play here, maybe js or something to do with the form fields.


*

simon1111

  • **
  • 7 posts
Re: PHP Limit not working
« Reply #10 on: February 02, 2025, 05:14:56 PM »
All those setting are set correctly and we tested uploads of 100 megs on the server yet the software wont allow me to change anything in the admin



As MB Themes said, you need to check your php ini configuration for:

ini_get('upload_max_filesize'): Gets the max file upload size from php.ini.
ini_get('post_max_size'): Gets the max post request size from php.ini.
ini_get('memory_limit'): Gets the memory limit from php.ini.

The value you are seeing is being retrieved from the smallest value of ANY of the above limits/sizes to ensure uploads stay within the safest limit.

Works fine here (except when all php limits are set to -1/infinity). I think you might have another issue at play here, maybe js or something to do with the form fields.


It works fine with a lower number. I can change it to 2000 as shown in this screen shot

*

MB Themes

Re: PHP Limit not working
« Reply #11 on: February 02, 2025, 10:28:40 PM »
Adding some details.

Code: [Select]
        $max_upload = $this->_sizeToKB(ini_get('upload_max_filesize'));
        $max_post = $this->_sizeToKB(ini_get('post_max_size'));
        $memory_limit = $this->_sizeToKB(ini_get('memory_limit'));
        $upload_mb = min($max_upload, $max_post, $memory_limit);

Code: [Select]
        if($maxSizeKb > $upload_mb) {
          $status = 'warning';
          $maxSizeKb = $upload_mb;
          // flash message text warning
          $error   .= sprintf(_m("You cannot set a maximum file size higher than the one allowed in the PHP configuration: <b>%d KB</b>"), $upload_mb);
        }

Code: [Select]
        $iUpdated += osc_set_preference('maxSizeKb', $maxSizeKb);

Means one of limits should be lower than your value.
You can also set this value on database
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

simon1111

  • **
  • 7 posts
Re: PHP Limit not working
« Reply #12 on: February 03, 2025, 03:20:06 PM »
Adding some details.

Code: [Select]
        $max_upload = $this->_sizeToKB(ini_get('upload_max_filesize'));
        $max_post = $this->_sizeToKB(ini_get('post_max_size'));
        $memory_limit = $this->_sizeToKB(ini_get('memory_limit'));
        $upload_mb = min($max_upload, $max_post, $memory_limit);

Code: [Select]
        if($maxSizeKb > $upload_mb) {
          $status = 'warning';
          $maxSizeKb = $upload_mb;
          // flash message text warning
          $error   .= sprintf(_m("You cannot set a maximum file size higher than the one allowed in the PHP configuration: <b>%d KB</b>"), $upload_mb);
        }

Code: [Select]
        $iUpdated += osc_set_preference('maxSizeKb', $maxSizeKb);



Can you tell me the exact database names we can edit to allow larger files
You mention we need to change 3.. What are those?

Means one of limits should be lower than your value.
You can also set this value on database