I am trying to override my upload_max_filesize in php but I still get the value which is in my php.ini file which is 2 mb.
ini_set('upload_max_filesize','30M');
ini_set('post_max_size','30M');
echo("<br>".ini_get('upload_max_filesize')."<br>");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.
Set them in
php.ini, your virtual host config, or in a.htaccessfile. A typical.htaccessfile would look like this: