How to increase the PHP memory limit in Drupal 6 without approaching hosting provider?

Just edit .htaccess file in your Drupal root directory. For example, I added the following two lines.

php_value post_max_size 100M
php_value upload_max_filesize 100M
php_value memory_limit 96M (this is vital for Drupal 6)

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
php_value post_max_size 100M
php_value upload_max_filesize 200M
php_value memory_limit 96M
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
php_value post_max_size 100M
php_value upload_max_filesize 100M
php_value memory_limit 96M
</IfModule>

It also works with drupal 5.7. But 100m become 50m when you try to set up the file upload at: /admin/settings/uploads

It works

Thanks.... I searched various forums but no result solved my problem... But yours works for me.... Once again thanks...

change settings.php

Did you try putting this into settings.php?

ini_set('memory_limit', '200M');

increase of memory

can i just do that for speed?

In the same way, can I put

In the same way, can I put these to settings.php?
ini_set('memory_limit', '200M');
ini_set('post_max_size', '100M');
ini_set('upload_max_filesize', '120M');

ini_set('post_max_size',

ini_set('post_max_size', '100M');
ini_set('upload_max_filesize', '120M');

do not work in settings.php