Saturday, January 8, 2011

Debug php code


1) Add the following at the top of your code:
ini_set('display_errors', 1);
error_reporting(E_ALL);
2) you can also check phpinfo
<?php
phpinfo();
?>
3) check php.ini
Some important setting:
extension module location
extension_dir = "C:\php\ext"
upload_tmp_dir, session_save_path and upload_max_filesize setting
extension=php_gd2.dll
for mysql
extension=php_mysql.dll
extension=php_xmlrpc.dll
4) check httpd.conf:
#PHP
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php-source .phps
PHPIniDir "C:/php" 

No comments:

Post a Comment