Friday, October 12, 2012

Enable mod_rewrite on apache2 server in Ubuntu

Open terminal write the following codes:

sudo a2enmod rewrite

sudo gedit /etc/apache2/sites-available/default


After executing the second code, a text editor will be open. Find the following code:

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


Edit and change like below:

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all


Then restart apache

sudo service apache2 restart

-That's all.

Increase Maximum Memory Allocation Limit without changing in PHP.INI

Add the following code in your php code if you want to increase maximum memory allocation for any of your specific script which execute to create or modify bigger graphical or other types of files.

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

800M represents 800 megabytes.