Magento white screen of death - php

I am trying to compile my magento store's code. Initially compiling was producing an error which I tracked down to the Fooman Speedster advanced module. I removed the module entirely from my store's code and again recompiled. The compilation successfully completed this time and all classes (around 7500) could be seen in the/includes/src/ folder.
However after compilation, my site's frontend is showing the white screen of death with no error being generated in the apache error log. What is strange is that the backend is working perfectly fine.
I have also increased my memeory limit for php scripts to 1024M so that php running out of memory is not the problem.
Any suggestions as to what might be the propblem or how to go about tracking the problem/bug.

Reposting my answer from here. Hope it will help
Magento white screen on Admin log in page?
I faced with the same problem. Actually it was even worse because it was a commercial product and a new hosting for me with really strange server configuration. So I couldn't made errors appear in any log file.
As I've found out the magento white screen means some PHP Fatal error occured. So there is a proper way to show them. Just add at the begin of your index.php
ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
$error = error_get_last();
echo("<pre>");
print_r($error);
}
And you will see what is really happening with your magento.

This is how I got it corrected(Hope will help you guys):
Use the following code in your index.php file
ini_set('error_reporting', E_ERROR);
register_shutdown_function("fatal_handler");
function fatal_handler() {
$error = error_get_last();
echo("<pre>");
print_r($error);
}
In my case it tolde me that error/503.php was unavailable.
3.The issue was with testimonial extension I used(http://www.magentocommerce.com/magento-connect/magebuzz-free-testimonial.html)
I deleted the testimonial.xml file in my app/etc/modules/testimoanial.xml.
delete “maintenance.flag" file.

I deleted all the folders from my var->cache directory and frontend started working.

As I read, it is caused by when your Persistent Shopping Cart enabled.
Set System > Configuration > Persistent Shopping Cart > General Options > Enable Persistence to disabled and try again.
You can have a look here.

It's a common problem with compilation, you can temporarily disable compilation by editing /includes/config.php and commenting out these lines:
define('COMPILER_INCLUDE_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'src');
define('COMPILER_COLLECT_PATH', dirname(__FILE__).DIRECTORY_SEPARATOR.'stat');

After a lot of research and testing, I have come to the conclusion that while compiling there may be several errors that lead to the white screen of death. These will not be visible for some reason leaving you with no clue as to where is the problem.
In most cases - custom modules or installed modules are the culprits. The only reliable way to debug the magento compilation is to use the xdebug.scream = 1 in the xdebug configuration. This will scream out the error file/reason which can then be worked upon.
A better explanation could be found here:
http://www.brimllc.com/2012/03/magento-fun-with-debugging-the-magento-compiler/

Another reason for not seeing any error in any log might be the APC cache.
See my Stackoverflow answer here for more details.
You can
disable it via .htaccess: php_flag apc.cache_by_default off
clear the apc cache every time the page is called: add at the top of index.php apc_clear_cache(); (no solution but good to see if the APC is the problem)

Related

Prestashop 1.7 Transplant a Module Page Temporarily Unavailable Error

I recently started experiencing a strange error every single time I try to visit the transplant a module page. From the design > positions page3 I click on the "transplant a module" button on the top right and it takes a really long time to load, but then it does not load at all. I get a blank page with the following error:
The page you are looking for is temporarily unavailable.
Please try again later.
5cb0af3eb5bd6096ecb4dce014d6635a 3a1c22abc23c754c0fb7be3b7c58431e 159cf03490b9d26b556696ed897a7daa
I contacted my server provider and they explained to me that the server I was using was reaching the max amount of files allocated, and that I needed to get a new server just for this particular site. So I did. I then cloned the site and database and brought it over to the new server....but I'm still getting this error everytime I try to transplant a module.
Any one ever encountered this issue? Any one have any ideas as to what could be causing this? Any suggestions on what I can do to troubleshoot this error further?
I have turned on debug mode, and it does not give any more information than what's above.
Thank you all,
Maybe you are facing the following known bug. It will be fixed in 1.7.5 (coming soon)
https://github.com/PrestaShop/PrestaShop/issues/10811
Sometimes module have some issues, I've a problem one day and this help me :
In config/xml copy the 2 files "must_have_modules_list.xml" and "default_country_modules_list.xml" on your PC in case,
And then delete the two files from your site,
This "refresh" the cache of your module config
Hope will help you
The "Transplant a module" page is now working after I changed the file AdminModulesPositionsController.php in /root/controllers/admin folder.
In line 449 changed:
$all_modules_controllers = Dispatcher::getModuleControllers($type);
to
$all_modules_controllers = Dispatcher::getControllers($type);
Try this, it's working for me.

Errors in plugins make a 500 server error with no error message on screen or in log

I have an issue with errors generated in WordPress plugins that is making development difficult for me.
If I trigger an error in a normal PHP file like so:
trigger_error("an error occurred", E_USER_ERROR);
It works fine and I will get the error displayed on the page. However, if I try the same in the code of a plugin the server generates a 500 error in browser and does not display the error.
In addition, it also does not log any error in the PHP-FPM or Nginx log file when occuring from plugin code. This is making development extremely difficult as when I get an error I have no information to go on.
As this is working fine in standalone PHP I am assuming it must be WordPress related.
I have debugging enabled in wordpress. My stack is as follows:
Ubuntu 16.04
PHP 7.0.4
Nginx 1.10.0
MariaDB 10.0.24
The file ownership is user:www-data. Directories are 775 and files are 664
Errors are enabled in the PHP conf files and I can see errors fine with standalone PHP pages, it is just happening on the server in context of errors happening in the WordPress plugins PHP pages.
This is very frustrating as I cannot see why this is happening. Does anyone have any insight that could help me figure this out?
EDIT
To be more clear here is what I have in wp-config to enable debugging:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
Other debugging values are defaulted to true so this should be all I need.
Curiously I have just noticed that error_log() does not do anything inside a WordPress file while trigger_error() will cause the 500 error.
This feels like some sort of permission based error but I am not sure what. I really need some help with this as development in this circumstance is practically impossible without any error text.
Wordpress disables error reporting by default. You can enable wordpress debug mode by setting to true the WP_DEBUG constant in wp-config.php.
Here you can find more detailated instruction:
https://codex.wordpress.org/Debugging_in_WordPress
The problem was caused by a plugin "Wordpress CSV Importer". I do not know why but removing it made debugging work again.

Codeigniter Blank Screen - Failing to load welcome class

I am in the process of migrating codeigniter from centos to ubuntu and after moving the files, adjusting the config files, etc, I am getting the white screen of death. Debugging it, the code seems to die in CodeIgniter.php at
$CI = new $class();
where
$class = welcome
I have confirmed the MySQL is installed and running, both in PHP and on the command line. Additionally, I can't find codeigniter complaining about any errors in either my apache error logs or the codeigniter ones at application/logs. This is despite setting the logging threshold to 4 and setting display errors to true.
the only solution for this issue to find the php error logs,
check it on /var/logs/apache2/errors.log or if you use ssl /var/logs/apache2/ssl_errors.log
this is the default paths for php error log
please check your php error logs for getting the error message.
There's 3 solutions to know where's the problem.
1- Codeigniter offer logs for configure it
go to application/config.php
Change $config['log_threshold'] = 2; //for debug messages
Each request you can find the log messages in
application/logs/..
or
system/logs/..
Don't forget to switch it off after fix your issue by change it to 0 or 1 for display error messages only.
2- Or you can Enable development mode but i prefer the first solution.
if you want to switch to development mode edit index.php in the main project files and change ENVIRONMENT definition to 'development'
this option show errors on the site front.
3- Or you can check the PHP log errors in
/var/log/apache2/error.log
or
/var/log/apache2/ssl_error.log
if you using https

Yii - 'white screen of death', debugging tips

I have a staging server running a Yii application that now gives a 'white screen of death'. I cannot see anything being ouputted to the screen (or even the source code when 'view source'), locally the same code runs without any issues.
Can anyone suggest a good routine to debug 'white screen of death' within a Yii application?
Getting a blank screen in yii is mostly because error_reporting is off.
Put
error_reporting(-1);
ini_set('display_errors', true);
in index.php should get your output back.
Note that you can always look in application.log and apaches error.log for informations when you don't have some output.
This is for Yii2
I found the code was failing in vendor/yiisoft/yii2/BaseYii.php at method autoload($className). It was failing at execution:
include $classFile; (line 293)
The cause in my case was a function method name declared twice.
You might be interested to know that you can discover the cause (which Yii2 suppresses through its own error-handling) by preceding the command with Chris's recommended code above https://stackoverflow.com/a/25139283/3125602. If you introduce them too early in the code, they get overwritten by Yii2's error-handling settings.
It is quite a simple issue and happens either when a script reaches the PHP memory limit or during a plugin or theme conflict.
Solutions :
Increase the Memory Limit :
Since this is regarded as one of the cause, it is recommended that the PHP memory limit be increased. Edit your wp-config.php file via FTP adding the following line of code:
define( ‘WP_MEMORY_LIMIT’, ‘64’);
This increases your memory limit to 64M. You might need to contact your host before you do it as some host don’t allow it from your end.
Deactivate all your Plugins :
Connect to your site via FTP and rename the wp-content/plugins folder to plugins_old to deactivate all your plugins.
Here is a detailed answer to the infamous "White Screen of Death" problem. Thank me later :)
https://www.perceptionsystem.com/blog/wordpress-errors-solution/

PHP Deprecated errors won't disappear on WordPress Dashboard

TL;DR : Upgraded PHP on our server which caused a bunch of Deprecated errors to appear in WordPress, tried a number of fixes but the errors won't go away.
PHP Version: 5.3.10
WordPress Version: 3.3.2
I have a WordPress installation that has been up and running for a little while now, with no complaint.
This week, we upgraded PHP on the server to 5.3.10, after the update, the WordPress Dashboard began filling up with errors like this:
Deprecated: Assigning the return value of new by reference is deprecated in /home/random/public_html/wp-includes/class-simplepie.php on line 738
A large number (I suspect 116) of errors like this (each on a different line) appear in
Incoming Links
WordPress Blog
Plugins
As advised by a number of posts around the WordPress forums, I disabled error reporting both at a file level (by adding error_reporting(0); to the top of wp-config.php and/or other files) and using PHP.ini. Phpinfo confirms that error_reporting = 0.
This had no effect, with the warnings still showing up on the dashboard.
I tried disabling all of my plugins and reverting to the default theme (with a mind to enable each one in turn to see if one of them was causing the issue) but the errors continued to appear.
Next, instead of treating the symptom, I went to see if I could fix the cause of the issue.
Getting deprecated error with Simplepie
and
Assigning the return value of new by reference is deprecated
pointed to class-simplepie.php having some out of date syntax inside.
Using find/replace in my text editor I swapped all 166 instances of
=& new
for
= new
And I am still seeing errors on my dashboard.
So, as far as I can see, there should be no errors to report, and if there were, they shouldn't be showing up anyway.
Wordpress is not running in debug mode.
A paste of my phpinfo can be found here: http://pastebin.com/Pk68sDL1 if it is of any use to anyone.
Not sure what to try next. Any tips much appreciated.
D
try this and u will not have this errors:
error_reporting(0);
ini_set("display_errors", "off");
ini_set("display_startup_errors", "off");
Or set the same directives in your php.ini file in your server.
I was having the exact same problem today and I also tried all of the solutions you listed. Eventually I realized that after I replaced
=& new
with
= new
in class-simplepie.php, I also needed to reload the modules in the dashboard. This doesn't seem to happen when you just refresh the browser page, or even hide the module and then show it again.
So I highlighted the Incoming Links module on the Dashboard and clicked Configure. I changed the RSS feed URL to anything else (google.com), hit Submit, and it worked. Refreshed that module with no more deprecated errors from class-simplepie.php. Did the same for the Wordpress Blog module and that also worked.
The only thing I cannot figure out is how to refresh the Plugins module. It doesn't have a Configure option and I can't get it to reload like the others.
Edit: Plugins module works now as well. Just needed time to reset.
I had these warnings as well. I stumbled across a message by a developer of simplepie that this happens with PHP5.3+ and is related to the compatibility to PHP4. Using simplepie v1.3-dev drops this downwards-compatibility and fixes that.
Download from GitHub
Add this to the top of your wp-config.php file, right after the first
error_reporting(0);

Categories