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

PHP

Ron Vennes
PLUS
Ron Vennes
Courses Plus Student 2,661 Points

httpd Error Log

I've got a php error in my code and I can't seem to visually find. On a 2015 post, I see someone suggested 'cat /var/log/httpd-workspaces/error_log'... If I open up the workspace console that file doesn't exist (nor does /var/log/httpd-workspaces directory).

Is there another way to view parsing errors in the workspace?

1 Answer

Chris Shaw
Chris Shaw
26,676 Points

Hi Ron Vennes,

It's a little verbose but place the below at the very top of your index file and you will see errors appear on the screen.

<?php

error_reporting(E_ALL);
ini_set('display_errors',1);
ini_set('error_reporting', E_ALL);
ini_set('display_startup_errors',1);
error_reporting(-1);

// erroneous code here...

?>

Hope that helps.