Diagnosing LAMP application problems

A few tips for diagnosing problems with your LAMP application.

IT WON’T INSTALL or IT WON’T RUN AFTER INSTALLATION
Confirm that you meet the application’s minimum requirements. A common problem is incompatible PHP settings; check them with phpinfo.php.

DAMN, IT WAS WORKING BEFORE
Ask yourself what has changed on the system since it last worked. A security update to part of the LAMP stack, perhaps? Is a needed partition running out of space?

GENERAL TIPS
Make sure each piece of the LAMP stack is working properly: Apache, MySQL, and PHP.

Try a different browser. My daily driver has JavaScript, cookies, and plug-ins locked down tight, which causes problems with some LAMP applications. I have another browser with promiscuous settings specifically for development use.

Review relevant logs. Apache’s logs are in /var/log/httpd: access_log (for successful requests) and error_log (for failed requests). I find it useful to give the command tail -f /var/log/httpd/error_log and then attempt to run the application. Error messages will scroll by in real time until stopped with Ctrl-C.

PHP has adjustable logging settings. I prefer to have the system-wide configuration /etc/php.ini set with secure, production values, even on a development box. Then I have another php.ini with development values (including verbose logging), on hand but not used. When debugging a PHP application, I copy the development php.ini to the root directory of the application, where its values will locally override the system-wide configuration.

Advertisements

About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s