|
||||||||
|
||||||||
Change Max PHP Upload file Size when you don’t have access to the PHP.ini file
Change Max PHP Upload file Size when you don’t have access to the PHP.ini file I just thought I would elaborate on this for those who do not know the problem I am describing is that certain servers don’t allow anything bigger than 2mb files to be uploaded via PHP. This can be changed my simply modifying the php.ini file. However Many servers deny access and so you can’t change this maximum file upload size (and they wont change it no matter how many emails you send). So . . . we have a problem There are ways around it don’t use php for instance and create a CGI script to upload the file but what if your server doesn’t allow CGI or you don’t know how. However an easier way is to first check your php settings by saving a file as info.php With this code <? phpinfo(); ?> Save it in your home directory and run it then scroll down to upload_max_filesize and it’s normally set to 1mb or 2mb right now some servers let you change these settings in your control panel or point you to the folder where php.ini file is located However some do not So . . . I have to change server or use a CGI right? No, wrong. The php setup looks for the php.ini file in the home directory as well as the place its currently located (normally /etc/php/) but it does this after it reads the original php.ini file so I just create a new php.ini file saved it on my root directory then the php setup reads the original file gets all the variables it needs the reads my php.ini file which contains just one line upload_max_filesize = 10M; This then overwrites the original value and lets me upload 10mb instead of 2mb This is not what the server intended as they want to limit upload sizes to stop movies and high bandwidth files being uploaded, however this does obviously raise some security issues but I’m happy as I can upload 10mb on restricted servers now via php so I don’t have to change all my scripts to outdated CGI. hope this helps someone any problems with this Email Me
|
||||||||
![]() ![]() |