You know it, I know it, we all know it. You’ve either picked up someone’s code, taken on an existing project or are coming back to an old project. It’s late, something’s gone wrong and you’re stuck with how to resolve the issue.
But it could also be Monday morning after a good holiday, it could have been a long weekend, or it could be a brand new project and you’re just lost for some odd reason. What do you do? How do you find that thread of reason that you can start to draw on to help you successfully debug your application and get it sorted out?Well, recently I’ve begun to compile a list of questions to ask yourself. Have a look at the started list:
The Web Server
- Have you checked your web server log files?
- Is the web server running?
- On Linux, run: netstat -tlnp | grep httpd
- Did it have any issues starting?
- What is in error_log, access_log if you’re running Apache?
- Have you attempted restarting your web server?
- Have you checked your operating system log files?
- Were there any errors logged?
PHP Error Reporting
- What’s your PHP error reportingset to?
- Is it set to E_NONE?
- Is it too restrictive?
- Do you have PHP logging enabled?
- Are your log calls set to the right levels – are they being filtered out?
- Where are you logging to?
- Are you logging to a mail server?
- Is it configured properly?
- Can it receive mail for your domain?
- Are you logging to a file?
- Is the file writeable by the web server user?
- Is the disk it’s on full?
- Are you logging to FirePHP/FireBug?
- Have you allowed access for your test site?
- Are you logging to a database?
- Is a connection being established correctly?
- Is the database schema created correctly?
- Is the filesystem the database is on full?
- What are the settings for all PHP libraries/extensions that you’re using?
- Using SoapClient?
- What’s ‘cache_wsdl’ set to?
- Do you have trace and exceptions enabled?
- Using Curl?
- What’s CURLOPT_FAILONERROR set to?
- What’s CURLOPT_VERBOSE set to?
- What’s CURLOPT_DNS_CACHE_TIMEOUT set to?
Now it’s not complete, not by a long stretch and that’s intentional. I’m only kicking off the discussion to see where it goes. I want your thoughts, your opinions, your ideas. What do you do, that you think others here in the community can benefit from?
What’s that little gem of an idea, novel approach, bash script or link that you use? Drop in a comment or send a tweet. I’m keen to hear your thoughts and ideas.
If you liked what you read and would like to see more, please retweet it, or give it a like on Facebook or even give it some Digg love. And we always value you feedback and comments.
Matthew is a freelance technical writer and technical editor
and regular contributor to a number of tech publications, including PHP Architect, PHPMaster, CloudSpring and New Relic. When he's not contributing there, he's writing content here on Malt Blue. What can he say, he's an avid technical writer and software developer. Get in touch
if you want awesome, up to the minute, technical content for your blog, business or publication.