Forums

Resolved
0 votes
Hello there,
this is the first problem I've come across that I can't seem to find a solution to on google or on the support forum for Clear OS.

I've followed this post - https://www.clearos.com/clearfoundation/social/community/where-do-i-set-the-php-upload_max

I've tried this - https://www.clearos.com/clearfoundation/social/community/configuration-restore-the-uploaded-file-exceeds-the-maximum-allowed-size

I've searched on the command line using this grep command (php -i | grep "Loaded Configuration File" and php -i | grep "php.ini")

I've edited all the php.ini files that I can find to try and change this from 2M to 100M and restarted the server but no change to the upload size for the server?

Is there something I'm missing?

Thanks,
Henry.
Monday, June 10 2019, 12:53 PM
Share this post:

Accepted Answer

Monday, June 10 2019, 05:31 PM - #Permalink
Resolved
1 votes
So I believe you want not only to change "upload_max_filesize", but also "post_max_size", the latter exceeding the former in value. See this forum link for hints

It wouldn't hurt to clarify how many files you're allowed to upload under the "max_file_uploads", keeping in mind that the total size in upload no matter the number of files cannot exceed the post_max value. I think the default to max_file is 20 at any rate.

It's not going to hurt to make the changes in the php.ini script in both /etc/ and in /etc/opt/rh/rh-php72/, the former config file being for the default v5.4. Make sure you restart the associated services, at command line
systemctl restart rh-php72-php-fpm.service httpd.service
The reply is currently minimized Show
Responses (8)
  • Accepted Answer

    Monday, June 10 2019, 05:50 PM - #Permalink
    Resolved
    0 votes
    Sorry I forgot to say that I also restarted the service with the command you provided just changing the 71 to 72

    systemctl restart rh-php72-php-fpm.service httpd.service

    Thanks.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2019, 05:47 PM - #Permalink
    Resolved
    0 votes
    Thanks Dirk,
    that worked for me.

    I change the values to

    upload_max_filesize = 20M
    post_max_size = 60M

    in /etc/opt/rh/rh-php72/php.ini

    Thank you for the help,
    Henry.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2019, 05:23 PM - #Permalink
    Resolved
    0 votes
    Thanks ,
    sorry for the double comments.
    I ran /opt/rh/rh-php72/root/usr/bin/php -v as root and the result is as below -

    PHP 7.2.10 (cli) (built: Nov 16 2018 15:24:33) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies

    That solved that little bit of confusion :)

    But what should I do about the php.ini not changing, should I just change it in /etc/opt/rh/rh-php72/php.ini and put the other php.ini files back to 2M or what would you suggest?

    Thanks again,
    Henry.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2019, 05:00 PM - #Permalink
    Resolved
    0 votes
    I know nothing about PHP, but I think you'll find 5.4 is also in use as it is the default version. At a guess, In Use means it is assigned to a website. If you run "php -v", it runs the version in your path. If you run "/opt/rh/rh-php72/root/usr/bin/php -v" you get a completely different answer.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2019, 04:59 PM - #Permalink
    Resolved
    0 votes
    I noticed something strange that when I did php -v in the command line it returned

    php -v
    PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

    When in the clearOS dashboard it states I'm using php7.2

    Not sure what to do?


    Look at his post
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2019, 02:46 PM - #Permalink
    Resolved
    0 votes
    HI Nick,
    thanks for the reply :)

    I'm use php 7.2 and have edited that file /etc/opt/rh/rh-php72/php.ini

    And just incase I also edited /etc/php.ini

    But still nothing works.

    I noticed something strange that when I did php -v in the command line it returned

    php -v
    PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

    When in the clearOS dashboard it states I'm using php7.2

    Not sure what to do?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2019, 01:37 PM - #Permalink
    Resolved
    0 votes
    Thanks Nick for getting back to me,

    I'm using php7.2 and I edited /etc/opt/rh/rh-php72/php.ini and restarted server but it didn't work

    Another thing I've noticed is that when I run php -v in the command line it returns -

    php -v
    PHP 5.4.16 (cli) (built: Oct 30 2018 19:30:51)
    Copyright (c) 1997-2013 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

    But in the ClearOS control panel I have php 7.2 selected and running.

    So I've edited /etc/php.ini aswell restarted and still no change.

    I'm not sure what I should do?
    The reply is currently minimized Show
  • Accepted Answer

    Monday, June 10 2019, 01:15 PM - #Permalink
    Resolved
    0 votes
    There are lots of php.ini's if you have the PHP extensions app installed. You'll find them in
    /etc/opt/rh/rh-php56/php.ini
    /etc/opt/rh/rh-php70/php.ini
    /etc/opt/rh/rh-php71/php.ini
    /etc/opt/rh/rh-php72/php.ini
    If you are using the default PHP (5.4), you want:
    /etc/php.ini
    It is unlikely that you want the sandboxed php.ini as that is for the webconfig only.
    The reply is currently minimized Show
Your Reply