Re: Alternative methods to change maximum file upload ini settings?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok, .htaccess seems to have solved/worked around issue - implemented following three lines in it:

php_value max_execution_time 300
php_value post_max_size 30M
php_value upload_max_filesize 30M

Thanks

Jacob Kruger
Blind Biker
Skype: BlindZA
"Roger Wilco wants to welcome you...to the space janitor's closet..."

  ----- Original Message ----- 
  From: Aziz Saleh 
  To: Jacob Kruger 
  Cc: php-windows@xxxxxxxxxxxxx 
  Sent: Tuesday, September 01, 2015 11:03 PM
  Subject: Re:  Alternative methods to change maximum file upload ini settings?






  On Tue, Sep 1, 2015 at 4:48 PM, Jacob Kruger <jacob@xxxxxxxxxxxxx> wrote:

    While am trying to use ini_set at the top of my script to change both
    upload_max_filesize: 2M
    post_max_size: 8M

    They seem to refuse to implement the changes - those are the values it's pulling out using ini_get() function both before, and after the call of the ini_set() function, and have tried both integer byte values, and short-hand values using the M suffix/unit, to set it to 20Mb?

    Am also implementing the hidden field to try work with this as well:
    <input type="hidden" name="MAX_FILE_SIZE" value="21474836480" />

    And, that's the very first field inside the <form /> tags, but, this just doesn't seem to want to cooperate - files smaller than the default values seem quite happy/comfortable to be uploaded, but, any file larger than that just includes error integer 1 inside the $_FILES["fil_field"] array/collection, which equates to an error relating to UPLOAD_ERR_INI_SIZE.

    Now, can edit php.ini on my windows dev machine to change/hard-code those values, but won't necessarily help in production environments, and really just not sure why this is not prepared to cooperate with ini_set, etc. - working under XAMPP, implementing PHP 5.5.11, running under apache 2.4.9, and, for example, if I try this on a production, debian box, with similar version numbers, then same behaviour?

    Stay well


    Jacob Kruger
    Blind Biker
    Skype: BlindZA
    "Roger Wilco wants to welcome you...to the space janitor's closet..."


  Those settings are not going to have any effect when set via ini_set.

  The reason is that PHP needs those values before your script is even executed. When an upload occurs, the target script is executed when the upload is complete, so PHP needs to know the maximum sizes beforehand.


  Either you modify php.ini or use .htaccess to over ride those values.


  Source: http://stackoverflow.com/a/949428/1935500

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux