Error: (Just an example. File name, memory size, etc. can vary)
How to fix it:
1. On a shared server
Open your .htaccess file and enter this line into it
Contact Your Host If This Doesn't Work
2. On a VPS/Dedicated server
First step for this is to locate your php.ini file in the server and to see what is the memory limit (this is shown in the error message). Create a file with the below code and name it something like “test.phpâ€
Upload this file to your site root and point your browser to this file, now it will show the phpinfo of the server, in this you will find “Configuration File (php.ini) Path: /usr/local/lib/php.iniâ€, this is your php.ini location. You can find the memory limit also in this page “memory_limit: 32Mâ€
Then you can use putty, SSH client, login to putty and locate the file php.ini and edit the memory limit.
After this restart your Apache for the changes to effect. You can do this through WHM.
If you dont have WHM installed then use this command
Code:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 71 bytes) in /home/xxxxxxxx/public_html/search.php on line 1155
How to fix it:
1. On a shared server
Open your .htaccess file and enter this line into it
Code:
php_value memory_limit 32M
Contact Your Host If This Doesn't Work
2. On a VPS/Dedicated server
First step for this is to locate your php.ini file in the server and to see what is the memory limit (this is shown in the error message). Create a file with the below code and name it something like “test.phpâ€
Code:
<?php phpinfo(); ?>
Upload this file to your site root and point your browser to this file, now it will show the phpinfo of the server, in this you will find “Configuration File (php.ini) Path: /usr/local/lib/php.iniâ€, this is your php.ini location. You can find the memory limit also in this page “memory_limit: 32Mâ€
Then you can use putty, SSH client, login to putty and locate the file php.ini and edit the memory limit.
Code:
Log in as root.
Type the following and hit enter: vi /usr/local/lib/php.ini
Now that you’re in vi, hit escape a few times then type the following
and hit enter: /memory_limit
That basically does a “find†in the file you’re editing.
Press the “i†key. This puts you in “insert†mode, which basically
allows you to edit things.
Change the current setting (probably 32M) to 64M (or whatever you want).
Press escape, then type :wq and hit enter. That says “save the file
and quit.â€
After this restart your Apache for the changes to effect. You can do this through WHM.
If you dont have WHM installed then use this command
Code:
/etc/rc.d/init.d/httpd restart