dsf6778 2018-10-25 07:23
浏览 71

aws ubuntu实例php最大文件上传不变

I am using aws instance for my file uploading functionality ( ubuntu php 7.0) when printing phpinfo(), it shows upload_max_filesize as 2M.

I need to upload larger images upto 10 MB. I have changed lines in php.ini files with upload_max_filesize to 30M which is found in the folder /etc/php/7.0/apache2/php.ini. and /etc/php/7.0/cli/ no effect and restarted the server with ssudo /etc/init.d/apache2 restart

There is no effect in the phpinfo result.

I created a php.ini and put it in the root folder with the lines

upload_max_filesize = 960M
post_max_size = 960M 

and tried uploading lager files , it is not working

Then I have created .htaccess with the lines

  php_value memory_limit 30M
    php_value post_max_size 100M
    php_value upload_max_filesize 30M

and tried lines in the PHP uploading script

 ini_set('post_max_size', '64M');
ini_set('upload_max_filesize', '64M');

The above actions do not help me in larger files, please help. me.

  • 写回答

1条回答 默认 最新

  • duandui2803 2018-10-25 07:31
    关注

    Have you restarted your web server after making changes ? You need to Change these two things "post_max_size, upload_max_filesize" in /etc/php/7.0/apache2/php.ini then definitely it will work.

    评论

报告相同问题?