Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Chloe Conn
3,217 PointsPHP debugging suggestions??
One thing that I’ve struggled with is error reporting. I’ve enabled it in the php.ini, and in my source code, and everywhere I can think of. Do you have any issues debugging your code, and what do you do? Or, does WordPress have some Magic Sauce somewhere that helps make PHP less angry at you?
1 Answer
Andrew Shook
31,709 PointsIf you are trying to turn on error reporting for php in Wordpress then you need to make some changes to the wp-config.php file. Copy and paste this code:
@ini_set( 'log_errors', 'Off' );
@ini_set( 'display_errors', 'On' );
@ini_set( 'error_reporting', E_ALL );
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG_DISPLAY', true );
,which can be found here, below line 81 of your wp-config file. Make sure you comment out this constant on line 81:
define('WP_DEBUG', false);
Once you do that you show be good to go.