Increase Memory PHP, Magento, WordPress by just changing in .htaccess

If you are on a virtual hosting then its a big problem to increase server php memory usage. Then we can simply modify the .htaccess file in root directory and increase memory.

if .htaccess file is not there then create one and add below code.

Then  simply modify the variable “php_value memory_limit 120M”

by default we will have 32M allocated we can increase it according to our requirement.

We can do this in any php apache technology or in Zend, Prado, Symfony, Joomla, CakePHP, CodeIgniter etc.

<IfModule mod_php5.c>

############################################

## adjust memory limit

#    php_value memory_limit 64M

php_value memory_limit 120M

php_value max_execution_time 18000

############################################

## disable magic quotes for php request vars

php_flag magic_quotes_gpc off

############################################




## disable automatic session start

## before autoload was initialized

php_flag session.auto_start off

############################################

## enable resulting html compression

#php_flag zlib.output_compression on

###########################################

# disable user agent verification to not break multiple image upload

php_flag suhosin.session.cryptua off

###########################################

# turn off compatibility with PHP4 when dealing with objects

php_flag zend.ze1_compatibility_mode Off

</IfModule>