scriptygoddess

01 Apr, 2003

Making your PHP code portable

Posted by: Lynda In: Lessons learned

Recently my host, for whatever reason decided that it would be a better idea to NOT display errors if there was an error in the PHP code. Therefore if you had a parse error, instead of getting a helpful display that said such and gave you the line number, the page would just show a blank screen.

I have absolutely NO idea why my host thought that was a good idea, but I don't care because there are certain settings in the php.ini file that I can override for my site only.

This article at evolt gives a wonderful overview of what to do and how to do it.

What I did to solve my problem was simply place the following in my .htaccess file:

php_flag display_errors on

Simple as that. You can do this with any .ini setting that is changable by all (some settings ONLY the host can control.)

From now on I'll probably stop bugging my host about such things and just change what I can change myself. There's no reason everyone on my server has to deal with the changes I suggest.

1 Response to "Making your PHP code portable"

1 | Jester

June 5th, 2003 at 4:19 pm

Avatar

Just a note, the reason some hosts config PHP so it doesn't display errors is for security reasons, to avoid giving away system file paths and such, MySQL information etc etc. You can have the option for PHP to log the errors silently and you can view the log file to avoid displaying errors to everyone and their dog.

I know you said you don't care, but other people may hehe.

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements