Did you added something to a perfectly working Joomla site, and you suddenly have a blank age instead your site? Chances are that you hit the memory limit allowed to you on your server. Memory limits help to keep scripts from running out of control or using up all of your free memory. This value is generally carefully set by your host's SYSADMIN to let the hosted sites to run smoothly without bottlenecking each other by overusing this precious system resource.

If your server is a true LAMP box, as Joomla prefers, then we might have the solution. But be warned, not in all circumstances you can do this, you might need to contact your hosting company to fix this for you. But let's be optimistic, and let's examine the possible solutions. fist of all you need to find out what amount of memory you are allowed to use currently. Simplest way to find it out is to go in your site's back-end to

Help>System Info>Php Information

and check out the value you will find there.

1. You have sysadmin rights and/or you are running a single site on your server

Highly unlikely, unless you are self-hosting the site - or you are working on some local WAMP/MAMP or similar solution. In this case you need to locate your hosts main php.ini file - generally is located in

/etc/php.ini

This may vary, you can find it, if you have enough rights. If you are on a shared host, this might still be possible, but it is dependent upon how your host has your account setup. It may or may not be easy to change. If you are unsure, submit a ticket to your website host. You are paying for their service, there is nothing wrong with asking them.

If you successfully located it, open your php.ini file. Search for memory_limit and change the value from the actual value - let's say 8M, to something bigger, like 16M or 32M. (don’t go much higher, try to find the lowest value wich is enough to let you site rolling.)

Save the file, then restart Apache via ssh using this commend or whatever method you prefer.

/etc/init.d/httpd restart

Check your site, to see if it's working, and check your phpinfo as was described above, and you should be back on track.

2. You are in a shared hosting environment OR you are running more, than one site on your server

Now, if you have more then one website on your server you most likely do not want (on ha shared hosting you simply can't) to raise your memory limit globally. but you might be able to do it on a per-site basis. To do it this way, you will make a change in your websites WEBROOT directory (most likely public_html on Linux boxes running cPanel). This technique is often referenced as an override. Not all web hosting companies are the same. and no two Linux boxed are set up in exactly the same way. But basically you have two ways to do this. Remember, this might or might not be possible. You will know if you are not allowed to use either techniques in two ways: one is to have Server 500 forbidden type of errors and your site will be down until you remove your modifications, or you will don't see any error message, just your commands will be ignored (you won't see any changes in phpinfo).

The .htaccess override.

In this case you instruct the apache to use different settings, as the server global setting using standard .htacess commands. Open up, (or create) a file in your SITEROOT/WEBROOT directory called .htaccess. Inside this file, add the line

php_value memory_limit 16M

Save it, and check your phpinfo again. No restart is required for this.

The php.ini method

If .htaccess didn’t work, some web hosts will let you use the local php.ini override trick: you can put a file called php.ini in any of your directories, and this will be interpreted in the given directory and all it's subdirectories. So you have to create - or modify - a php.ini file in your WEBROOT directory. Inside that file, insert the line:

memory_limit = 16M

Save it, and check your phpinfo again.

Make sure you check your site after every change you make. If your site gives you the infamous "Server 500′s", then your host does not permit the method you tried, and revert your changes. Of course, use only one of above mentioned tricks, never use them in the same time.

0
0
0
s2sdefault
Category: Joomla Troubleshooter