When debugging
PHP or trying to solve problems like a
Blank Page, the first thing you will be told is to show
PHP errors, and the usual ways you will be told to try are:
- =>changing php.ini
- =>adding an htaccess file to your PN root
These both work well - when you can use them. Many don't have shell access and cannot change their php.ini files, and some will not be able to use htaccess because of other server configurations over which they have no control.
Fortunately,
PHP has many ways to do things.
Go to config.php and at around lines 77-80 you will see the following:
global $pndebug;
$pndebug['debug'] =
0;
$pndebug['debug_sql'] =
0;
$pndebug['pagerendertime'] =
0;
Add a line and change the first flag from 0 to 1 so it looks like this:
global $pndebug;
$pndebug['debug'] =
1;
$pndebug['debug_sql'] =
0;
$pndebug['pagerendertime'] =
0;
error_reporting(e_all);
Now you will see error messages on your pages. (There are a few that won't show up, but most will.)
Make sure you comment out the last line when you are done. Putting // in front of error_reporting will turn it off. This is important because the error messages will confuse the devil out of ordinary users and can give hackers information you don't want them to have about your file structure.
Hope this tip helps folks. It is a quick and easy way to turn
PHP errors on and off while mucking around.
Peter
edited by: pheski, Sep 14, 2007 - 09:45 AM
--
Peace
______________________________________
The commonest cause of problems is solutions.