By Jboo on
Hi,
I'm running a couple of modules that require the uploading of files. However the file size is limited and one of the modules (audio) mentions to change the settings in the php.ini file. Where can I find this file?
I've looked through the files in my ftp but can't find it.
Thanks for any help.
Comments
shared hosting?
if you're on a shared hosting account, your host will most likely not allow access to the actual php.ini.
If your host allows you to set custom php.ini file:
create a new plain text file called php.ini with the following lines (for increasing file upload size limit, eg. 10M)
upload_max_filesize 10M
post_max_size 20M
and place that php.ini in the root of your website.
If your host doesnt allow this, add the following lines to the .htaccess file
php_value upload_max_filesize 10M
php_value post_max_size 20M.
Once you have done so, to confirm create a phpinfo file* and check php settings.
Php info file is just a plain text file with the following code:
save it as info.php and upload to the root of ur site and browse to it. Make sure you delete it after you've done checking/development. It would suck if google indexed it.
contact your host if none of the above work.
Also
You can also set some of the PHP settings in your settings.php or .htaccess file.
If it is a server wide setting though, you might not be able to change it yourself on shared hosting. phpinfo() will let you know whether or not the change worked.
settings.php example:
.htaccess example:
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Thanks
Thanks both of you, I'll try your suggestions.
My new EasySnoozing, Nursing and BusinessEgghead websites on D7!
.htaccess
Just to add to this - I have read in guides that starting in the last couple of versions of php that you can no longer pass these parameters in the .htaccess file... this is not correct. I have adjusted my max file sizes in the drupal .htaccess file and it works just fine using php 5.2.
Though changing the php.ini file is the "correct" way of doing it - adding the lines to the .htaccess file results in the same functionality - and this will be the only available method for most folks on shared hosting.
Fom me, this causes WebFM to fail
I added these two lines in .htaccess. I wrote and ran the phpinfo thing. My local settings for max file size were set to 10M, although the master settings were still 2M.
The big problem is that WebFM won't load any directories after I do this. Does this make any sense?
I'm struggling with filesize
I'm struggling with filesize settings with WebFM as well. It seems to me that both the admin/settings/upload and admin/settings/webfm forms lie. phpinfo confirms for me that I have my uploads set to 100M, but these settings say it's set to 4MB. Of course my only php.ini (/etc/php.ini) says 100MB. So what's up?
Check Memory limit
Refer: http://drupal.org/node/177705
Took me ages to find this, I'm using WebFM on Drupal 5.7 and updating .htaccess in my root directory worked - specifically:
About the values you need to add, the php documentation says that for upload_max_filesize to work:
- post_max_size must be bigger that upload_max_filesize
- memory_limit must be bigger than post_max_size
There is also a Drupal limitation (by design) which won't let you upload a file bigger than half your post_max_size. So, to be able to upload 8M files you could use (for example):
In php.ini, at the end:
Or, in .htaccess, any place.
location of php.ini file
Now location of php.ini file is /etc/php5/apache2/php.ini
for more info on php.in