I am trying to change the default value of upload_max_filesize in php from 2M to 10M. I have found the php.ini file on my system at /etc/php.ini.default and changed upload_max_filesize value but when I am checking it using phpinfo() function it is showing defaut 2M value inside table. I have also restarted the apache server using sudo apachectl restart command but no luck.
You should copy /etc/php.ini.default to /etc/php.ini first and then restart the apache server. When php.ini file will be present on the location - /etc/ then the settings will be configured from this file not the php.ini.default. To copy file run below command
Now restart apache server by below command