Live site blank in frontend or keep on loading and never load
First enable Developer mode in your .htaccess
file, add the following at the end of the file:
SetEnv MAGE_IS_DEVELOPER_MODE "true"
Next edit index.php
and uncomment the line:
#ini_set('display_errors', 1);
Line referenced:
- https://github.com/OpenMage/magento-mirror/blob/magento-1.9/index.php#L73
Next login via SSH and look for a core dump file under /tmp
as the segment fault error mentioned. Sometimes it can also be in the root /
or in the root directory of the site itself for example: /var/www/html/videomergerapp/
.
If you are unable to locate any core dump files, you may want to add some additional directives to PHP/Apache.
Take a look here:
- https://serverfault.com/questions/470407/how-to-get-a-core-dump-from-apache-when-segfaulting
- http://www.cyberciti.biz/tips/configure-apache-web-server-for-core-dump.html
Once you have the core dump file(s), you can use gdb
(if --enable-debug
) was used when PHP was configured. You can make this determination by issuing the following from the Command Line:
php -i | grep debug
or simply creating a php script file in your webserver root with: <?php phpinfo(); ?>
in its contents and view the file via web browser to see the PHP configuration values.
- https://bugs.php.net/bugs-generating-backtrace.php
If it was not enabled, then you won't be able to get a full backtrace into PHP itself but only higher level system calls and/or apache backtrace:
If you do have access to the core dump file issuing something like the following will give you a backtrace to help find the point of failure:
gdb /usr/local/apache2/bin/httpd /tmp/core.2027
If you are only experiencing the random issues on the frontend and never the backend, then most signs point to a possible issue with your template coding. Once you experience the blank pages (and/or error displays if you have enabled developer mode and error display). Login to your admin and disable all caches and flush all caches and cache storages.
Then going into app/etc/local.xml
and set the disable local modules to true.
<disable_local_modules>true</disable_local_modules>
This will disable the auto loader from loading any modules in app/code/local
.
To disable community modules it is easiest to go through each of your modules definition files found in app/etc/modules
and disabling by setting the active node to false like so:
<active>false</active>
This way you can help rule out if a 3rd party module is causing the source of the issue by process of elimination. NOTE: You can not disable_local_modules
and simply go through all of your NON-CORE modules (anything Mage_* ignore!).
If there is still issues then I would attempt a default template package temporarily by going to System > Design and defining a new design of something like default or base. If the stock template packages work then you will know the cause of the error is living in your template design files (.phtml).
A lot of templates I've run into are bad about using Mage::getModel()->load()
within foreach loops as this is bad practice and can ultimately consume large amounts of server memory and resources.
Magento does have Code Analysis tool that may help scan your template files to determine if there any of these bad pieces of code:
- https://github.com/magento-ecg/magniffer
Further reading:
- Fundamentals for debugging a Magento store
Also, it may be helpful for everyone what cache and session storage you are using that is defined in app/etc/local.xml
.
Hope this helps!
My guess is there is a recursion in your code. Edit the file lib/Varien/Db/Adapter/Pdo/Mysql.php
and set $_debug
and $_logCallStack
to true. This should log the call stack in var/debug/pdo_mysql.log
file which should give you an idea if there is a recursion in your code when it takes forever to load. Note that this file will keep growing very rapidly so ideally enable it when you think the problem has started on site.
Other way is to disable buggy modules/extensions that you think could cause this. This could be your simple configurable prices extension too, try to disable it temporary and see if it helps prevent the issue.
I had the same issue in a customer website. Check your Magento for malware.
This is a well known scenario, ususally it is a walware redirecting the content of user's post to an external website.
Start checking index.php, they usually hack it. Scroll the code untill the end, also check to the right and between commented lines in the license heading. Hackers are used to hide code in this way.
You have the "forever loading" becasue it tries to contact websites that your ISP blocked.
It should be quite easy to find the malware, search for "base64", "eval", "mcrypt" strings.