Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Displaying errors to the screen during development is just the first step. The developer won't always run across every possible error and what about errors that happen in production? That’s where logging comes in.
The .htaccess
file, as mentioned in Before You Start, is only applicable for locally hosted servers or a hosting server you have access to. If you'd like to follow along with that part of this video, make sure that you are developing using a local PHP Dev Environment.
Settings for Your PHP File
Open logging.php. At the top of the file we have some log options using the ini_set function:
ini_set("log_errors", 1);
ini_set("error_log", "php-error.txt");
Settings for an .htaccess File
# log errors
php_value log_errors 1
# log file for errors
php_value error_log php-error.txt
Settings for the php.ini File
Replace the following path with the full path your log file.
log_errors = On
error_log = "/Applications/MAMP/htdocs/php-error.txt"
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
devis
4,059 Points1 Answer
-
<noob />
17,063 Points2 Answers
-
Frederik Hulleman
PHP Development Techdegree Graduate 15,232 Points0 Answers
-
Sean Flanagan
33,236 Points2 Answers
-
mkooij
8,886 PointsThe workshop files you start with in this course do not match up the video content.
Posted by mkooijmkooij
8,886 Points0 Answers
-
A X
12,842 Points1 Answer
-
filipepacheco
Full Stack JavaScript Techdegree Student 21,416 Points0 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up