.htaccess
Edit the .htaccess file in the Drupal root directory. Look for the section:
# Override PHP settings. More in sites/default/settings.php# but the following cannot be changed at runtime.
and immediately after this add the following line:
php_value memory_limit 32M
This method will only work if PHP is running as an Apache module.