NameSilo

PHP Max Upload Size

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Ik

Quality //VIP Member
Impact
8
Hello PHP Gurus,

I have 2 questions.

1- How can I display the php.ini max. file upload limit on my page?
2- Is there a way to change that limit without having to directly accessing the php.ini, or using htaccess?

Thanks
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
1- How can I display the php.ini max. file upload limit on my page?

Code:
<?php echo ini_get('upload_max_filesize'); ?>

2- Is there a way to change that limit without having to directly accessing the php.ini, or using htaccess?

I don't think so. You could try ini_set(), but I think that by the time the script executes it is too late.

There are other factors which influence the maximum file size that can be uploaded, such as the "post_max_size" setting, and also settings in the web server which may limit maximum upload sizes.
 
0
Close
Code:
<?php echo ini_get('upload_max_filesize'); ?>



I don't think so. You could try ini_set(), but I think that by the time the script executes it is too late.

There are other factors which influence the maximum file size that can be uploaded, such as the "post_max_size" setting, and also settings in the web server which may limit maximum upload sizes.

Great. Thanks a lot
 
0
Close
ini_get is worth a try.

Though, in most cases, you'll have to modify the php.ini file's max.
 
0
Close
0
Close
0
Close
You can typically put a php.ini file into the directory you wish to change settigns for, only putting in the elements that you need to change. Also if changing the max upload size, change the max post size as well.
 
0
Close
You can typically put a php.ini file into the directory you wish to change settigns for, only putting in the elements that you need to change. Also if changing the max upload size, change the max post size as well.
Typically, you can only do this if PHP is run as CGI/FastCGI, not mod_php - if the setting you're trying to change is PHP_INI_PERDIR/PHP_INI_ALL (and SAPI = mod_php) then you can use .htaccess.
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back