I try to access my custom components on view and sub controller like
http://www.whizzrd.com/administrator/index.php?option=com_osservicesbooking
I have tried everything, still i didn't know what is the error.
1.added this code on com_yourcomponent/yourcomponent.php
ini_set( 'display_errors', true );
error_reporting( E_ALL );
enable debug in global configuration and set the error_report to development
but I'm still getting blank pages. still not yet find the error
Thank you in advanced
Go to Global Configuration in Admin panel and Server Tab and there do Error Reporting to Maximum.
Doing this setting you will be able to view the error you are getting.
Global Configuration-> Server-> Error Reporting -> Maximum
Try with adding your view name.
http://www.whizzrd.com/administrator/index.php?option=com_osservicesbooking&view=osservicesbookings
Also check filename and component names if it seems differ or capital.
My problem was that I had typed defined('__JEXEC') or die (two underlines before JEXEC) and it is supposed to be defined('_JEXEC') or die and as I had not set a message for die it basically just displayed a blank page with nothing. Took me a couple of hours to figure it out. Best thing I did was to start adding a different message in my die statements and then it will display the die message of the page with errors.
Related
I have a problem with my Wordpress site, more specifically, The7 template. On every page, including the main page at the bottom of page below footer I have 4 Warnings which are the same:
“Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘wp_filter_content_tags’ not found or invalid function name in on line”
I do not know how to solve it/turn it off. Could you tell me which PHP page or what exactly cause this problem to appear? It’s really annoying. Due to the fact that it is in the main body and not in any div/b/p/etc. tag I cannot hide it with CSS just for a while.
Kind regards
Peter
Hiding error reporting on prod
On prod you want to avoid showing errors, due to security and user experience reasons. To achieve this, in PHP you can run
error_reporting(0);
or, even better, in php.ini, you can have this line
error_reporting = off
What the error means
The error tells you that a function is to be called by name, but it does not exist. wp_filter_content_tags does not exist in your context.
Solution to the error
Even though you have hidden error reporting on prod, you still need to show errors on dev and that function might do something very useful. From the doc you can see that it's located in wp-includes/media.php. So, if you do not need to call this function, then search for its calls and remove them. If you need this function, then require or include it into your files. If, for some reason you cannot remove this function (for ex. you do not want to hack a template that might have some versions in the future), but the function/file is not helpful for you, then you can implement a function with the same name.
Thank you very much for answer. I used it to find solution and in my case there is a need to change wp-config.php a little bit. It means to add these specific lines to code:
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false)
In my case it worked and no more errors / warnings showed on every / main pages.
Kind Regards
Peter
Trying to figure out why a Wordpress site I moved is doing white screen of death.
Trying to turn on error dumping - but it isn't working. Absolutely nothing is showing up.
Here's sample code:
<?php
ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);
$con = mysql_connect('localhost', 'groupasa', 'groupasa');
$selected = mysql_select_db("groupasa",$con)
Echo "Test";
?>
for a fatal error you can turn on errors in php code you have to turn them on in apache or htaccess level. You could also go and look in the error log for the errors.
Right click and check the source of your page, sometimes the html doesn't show the error but it's actually in the code.
Not sure if this is the case but hope it helps.
Try putting the Echo statement at the very top of the page and then an exit; if the echo displays then your PHP compiler is working fine and you know that the issue is with the code on the page.
next, add the missing semicolon at the end of mysql_select_db line
you could also check your PHP error logs.
Most times you can solve the 'white screen' by going into the database and using the following query to forcibly 'deactivate' all active plugins.
UPDATE wp_options SET option_value = '' WHERE option_name = 'active_plugins';
The core of WP is pretty solid, but it's the plugins and garbage that really mucks everything up.
I've been working with PHP for a while, but fairly new to Smarty.
I'm working with Prestashop and I've noticed Smarty seems to eat up all PHP errors - when there's an error in the PHP code, the .tpl file just outputs a blank page. I've been trying but I can't get Smarty to display whatever the PHP code outputs, even if there's an error.
PHP error reporting is set to show errors.
So, for instance, let's say this is the example.php file:
<?php
//included classes etc go here, irrelevant for this issue
error_reporting(E_ALL ^ E_NOTICE);
echo obvious wrong syntax"
?>
This file is connected to example.tpl which fits the output in a template block.
Obviously, it should throw an error. How do I make Smarty actually display that error?
To activate debug mode, go to config/config.inc.php
Find the following lines and chage off to on for the first one and set to true the second
/* Debug only */
#ini_set('display_errors', 'on');
define('_PS_DEBUG_SQL_', true);
This will display PHP and SQL errors (this would probably be enough for you to resolve "blank page").
There is also a blog post on prestashop site about p() and d() methods and how to track exceptions
To activate templates debug in Prestashop version older than 1.5,go to config/smarty.config.inc.php
Find the following line and set it to true
$smarty->debugging = true;
When you refresh your page, themes/debug.tpl should be rendered.
To activate templates debug in Prestashop 1.5+ you can enable Smarty debugging via Admin panel
Preferences > Performance > Smarty
and set Always open console but console will be opened for everyone ( not good for live site :) )
or set Open console with URL parameter (SMARTY_DEBUG) and add ?SMARTY_DEBUG to the end of your URL to see console
Hope this helps.
I've seen #Sergei Guk's answer and off-course, it's a pretty good answer. However, prestashop has since released version 1.6.
So if you want to show all the errors in prestashop v 1.6.0.6, you just need to go config/defines.inc.php
Replace define('_PS_MODE_DEV_', false); with define('_PS_MODE_DEV_', true);
What it actually does is set a constant and in the next line it checks if "_PS_MODE_DEV_" is true then it will show all kinds of errors in prestashop
if (_PS_MODE_DEV_)
{
#ini_set('display_errors', 'on');
#error_reporting(E_ALL | E_STRICT);
define('_PS_DEBUG_SQL_', true);
}
else
{
#ini_set('display_errors', 'off');
define('_PS_DEBUG_SQL_', false);
}
I have tested it and it works fine.
Set the $error_reporting variable.
See http://www.smarty.net/docsv2/en/variable.error.reporting.tpl
My problem was, after migrating a website to another server using backup buddy, I came upon a the white screen of death.
I turned on debug mode in Wordpress and still no errors, just white screen.
So I tried removing all the files and re uploading them again and leaving the database as is (the one imported by BackupBuddy) but it's still giving me white screen.
So I tried to trace the specific line where the white screen occurred and got stuck in a weird behavior.
In /wp-content/plugins/woocommerce/widgets/widget-init.php:
include_once('widget-cart.php');
include_once('widget-featured_products.php');
include_once('widget-layered_nav.php');
include_once('widget-price_filter.php');
include_once('widget-product_categories.php');
include_once('widget-product_search.php');
include_once('widget-product_tag_cloud.php');
include_once('widget-recent_products.php');
include_once('widget-top_rated_products.php');
When I add a "die('boom');" before
"include_once('widget-price_filter.php');" = boom is printed out.
When I add a "die('boom');" after
"include_once('widget-price_filter.php');" = boom is NOT printed
out.
So it's safe to say that the bug is inside widget-price_filter.php right?
The problem is when I add a die at the beginning of widget-price_filter.php, it does not print it out. It's like the line where the error occurred is nowhere.
What could be the cause for this?
So it's safe to say that the bug is inside widget-price_filter.php right?
Yes, totally (and you followed the correct way of debugging).
The problem is when I add a die at the beginning of widget-price_filter.php, it does not print it out. It's like the line where the error occurred is nowhere.
If (as you say you've done) you have added die('HELLO'); right at the top (after the <?php) and it does not appear - this means there is one of two problems
File not found
A syntax error in that page.
You can solve in 1 of three ways:
Check the php error logs (if you have access)
Before you call the "include_one" (in init.php) add:
error_reporting(E_ALL);
ini_set('display_errors', 'on');
Completely empty the code (just leaving the <?php die('HELLO'); ?>, check that appears and then add code in bit by bit.
If you got route 2, remember to take it out when you've got it working. Very important!
+1 for actually taking time to try to solve it yourself before posting (with the echo and die). So I hope that helps with the rest.
I was wondering how can I stop PHP & MySQL errors from displaying to users but still have the errors logged in the server so I know something is wrong.
two ways:
Config your php.ini (turn error off)
Put a # after any action...
Example:
<?php
$a = #mysq_query("a bad query");
echo #$b; // $b donst exist, so thrwos an error but with the # dosnt show anything
?>
I want to point out that there is a good reason to surpress MySQL Errors. If there error gives away too much info about your database set up and schema (by showing the query in the error... joins... etc.) you don't want a live site showing those errors to the public. Of course you would want to log them. So in the interest of security this is a good single reason to not display them on a live site. As I said logging yes. Displaying no.
http://www.php.net/manual/en/errorfunc.configuration.php
Set display_errors to zero and define a log file with error_log in your php.ini or with ini_set or something.