简体   繁体   中英

The upload_max_filesize in php.ini on my shared server is not working

I want to upload files on my shared server but i am not able to do that when my file is bigger than 2MB. I know the problem is the upload_max_filesize in php.ini but the thing is that on the php.ini file its already 8M. Now i dont know what should i do. Since i am using shared hosting i dont have any access of php.ini file. I can just see its reference. I tried writing my own php.ini file in the public_html folder like this:

upload_max_filesize = 5M

And wrote .htaccess file outside public_html like:

    <IfModule mod_suphp.c>
suPHP_ConfigPath /path_to_homedirectory/public_html/php.ini
</IfModule>

but this is not working either. Can you suggest some other way or if i had done any mistake please let me know. Any help would be appriciated. Thank you.

If you want to go through .htaccess way set below vars in your root .htaccess file.

php_value upload_max_filesize 8M
php_value post_max_size 8M

But make sure you have permission to set php_value.

And if you want to go php way, you may try ini_set but I am unsure about it.

ini_set('variable_name','value');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM