如何在不使用php.ini文件的情况下增加php中的文件大小

I am using following code for increase uploaded file size in php but it is not working.and I want to change the file size without using php.ini file and .htaccessfile.

ini_set('post_max_size', '500M');
ini_set("upload_max_filesize",'500M');
echo("<br>".ini_get('upload_max_filesize')."<br>");

These values both have the changeable-mode PHP_INI_PREDIR meaning they can be set using php.ini, .htaccess, httpd.conf or .user.ini but not ini_set(). This is because the post has already been received before the php script starts and ini_set() would have no effect anymore.

Check the overwiew about core settings in the PHP manual. It shows all the settings and where they can bet set. Also you can find an overview of the possible change locations.