开发者

cannot change php upload size limit

开发者 https://www.devze.com 2023-03-26 20:14 出处:网络
I used uplaodify plugin to upload music files. Everyting is okay in my local uploadify.php file is in public_html/uploadify directory

I used uplaodify plugin to upload music files. Everyting is okay in my local

uploadify.php file is in public_html/uploadify directory

i want to increment my upload file size limit to 10 MB

i tried to put

php.ini file in public_html

post_max_size = 500M
upload_max_filesize = 500M
max_execution_time = 900;
max_input_time 900

and I am looking my phpinfo() thats good but ı cannot upload bigger than 2MB

And i tried to put same php.ini in public_html/uploadify

Now I can upload file which size 2.5 MB , but no upper;

And

ini_set('upload_max_size','10M');
ini_set('post_max_size','10M');
ini_set('max_execution_time','900');

lines is in the my index.php and uploadify.php

What should I do increment my file upload size limit

EDIT

I look $_F开发者_运维问答ILES[..]['error'], and its 7

UPLOAD_ERR_CANT_WRITE

    Value: 7; Failed to write file to disk. Introduced in PHP 5.1.0.

But I can upload file which smaller than 2.5 MB


Edit the .htaccess file in the root folder and add these values:

RewriteEngine On
php_value post_max_size 1000M
php_value upload_max_filesize 1000M
php_value max_execution_time 6000000

You can edit it to suit your needs. 1000M = 1GB, so edit accordingly. Do note that your host will need to allow PHP edits.


You cannot override upload limits from within a script using ini_set - the upload will have completed (or been aborted) using the original settings long before PHP fires up and processes the ini_sets.

You can't just litter php.ini files around your system either - php doesn't load random .ini files it finds lying around. It only loads them from specific locations. If PHP hasn't been told to load one from the uploadify directory, you'll have to use a .htaccess and php_value directives.


Hello I had the similar issue while uploading a theme on wordpress on localhost. After hours of research I was able to put following 3 lines in my php.ini and restarted the apache and it worked. I thought this will help others.

This will go in file upload section of ini

upload_max_filesize = 800M

post_max_size = 800M

max_file_uploads = 800M

0

精彩评论

暂无评论...
验证码 换一张
取 消