Changes to upload_max_filesize in Ubuntu php.ini will not take effect

前端 未结 9 2296
耶瑟儿~
耶瑟儿~ 2020-12-05 04:54

I have been trying for two days to increase the max filesize for file uploads via php to 10M from the default 2M. I change the php.ini file that is referenced by phpinfo to

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 05:16

    I had exactly the same problem and solved it using these steps:

    When running the following command on my server

    php --ini
    

    I got the following path of my php.ini

    Loaded Configuration File:         /etc/php/7.0/cli/php.ini
    

    I kept on making changes in this php.ini file, but none of the changes took effect. I then created a file called info.php in my /var/www/html directory and added the following code

    
    

    Then I opened the file in my browser http://example.com/info.php, where I saw that the actual loaded php.ini file was in a different directory

    Loaded Configuration File   /etc/php/7.0/apache2/php.ini
    

    When I made changes to the php.ini file inside of this directory, all the changes took effect. In summary make sure that you run the phpinfo(); function to make sure of the actual php.ini file which php uses.

提交回复
热议问题