indz Posted May 25, 2010 Share Posted May 25, 2010 Hi All, I am looking for suggestions to help debug this problem ASAP. I am fairly new to PHP, this is my first database attempt. I am using a Computerized Maintenance Management System obtained for free from http://www.maintenance-software.org/. I think I have the database information entered in properly, it is shown below: <database type="mysql"> <server>localhost</server> <login>root</login> <password></password> <default>cmms</default> </database> I'm running the system using windows XP Pro, PHP 5.3.1. The attachment contains the original open source files. Thanks in Advance [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 25, 2010 Share Posted May 25, 2010 A) Blank php pages are usually caused by fatal parse or fatal runtime errors. Are you developing and debugging this on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will both report and display all the errors it detects? You will also want to go through the code and remove/comment out any lines that are setting error_reporting/display_errors. B) This is the second major script I have seen lately that puts sensitive information into a .xml file (i.e. your database connection details.) However, anyone that recognizes the script will know that they can simply browse to the site.xml file and get your database connection information. You must take steps to insure that the site.xml file is not web accessible. You either need to prevent http access to the file or move it to a folder that is not web accessible. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062936 Share on other sites More sharing options...
indz Posted May 25, 2010 Author Share Posted May 25, 2010 Hi There, Thanks for the reply. I added the code to the PHP page....index.php <?php ini_set('display_errors',1); error_reporting(E_ALL); require "config.php"; $site = new CSite("./site.xml",true); $site->Run(); ?> I am still getting a blank page. I've also tested in a live server (Windows platform), still getting a blank page over there. Thanks again for the quick reply. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062942 Share on other sites More sharing options...
PFMaBiSmAd Posted May 25, 2010 Share Posted May 25, 2010 A) I did not state to put the settings into your code (because doing so won't cause fatal parse errors, the most common reason for a blank page, to be displayed.) B) The site.php file sets error_reporting to 0 and will hide any runtime errors, unless you commented out the line to prevent it from doing so. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062950 Share on other sites More sharing options...
indz Posted May 25, 2010 Author Share Posted May 25, 2010 Just was wondering is this code supported in windows platform and latest php version. thanks again for the quick reply. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062953 Share on other sites More sharing options...
PFMaBiSmAd Posted May 25, 2010 Share Posted May 25, 2010 That would be question for the Author of the code. Until you debug what is causing the blank page, you won't know. You could be missing a php extension the code relies on or the code could be using some depreciated feature that is tuned off in the php.ini on the systems that you have tried it on. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062955 Share on other sites More sharing options...
indz Posted May 25, 2010 Author Share Posted May 25, 2010 Hi there, i've commented out error_reporting to 0 in the site.php and I do get this error: Fatal error: Cannot redeclare CSQLAdmin::$functions in C:\xampp\htdocs\cmms\lib\sqladmin.php on line 30 I really don't have idea what the problem is about. Please do advise. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062956 Share on other sites More sharing options...
PFMaBiSmAd Posted May 25, 2010 Share Posted May 25, 2010 There are two lines in that file that define the same variable. You could comment one out and see if it works. However, since that error would have always prevented the code from working, I seriously doubt that you will be successful in getting the overall script to work. Who would have posted a script that fails to run due to a simple error in the source code? Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062958 Share on other sites More sharing options...
indz Posted May 25, 2010 Author Share Posted May 25, 2010 Thanks for the quick reply. When i commented out the one of repeated (similar) variable declared, I'm getting this error: Notice: Undefined index: NAME in C:\xampp\htdocs\cmms\lib\config.php on line 107 I know I must replace one of the repeated variable with another variable in order to resolve the error but I don't know exactly which variable to declare. Please do advise on that. Anyway have you tried to run the code? I need to complete this asap. Need your urgent help. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062969 Share on other sites More sharing options...
PFMaBiSmAd Posted May 25, 2010 Share Posted May 25, 2010 You can safely ignore that error. The code on that line should have been properly written as - if (isset($this->attr["NAME"]) && $this->attr["NAME"] != "") Frankly, you are going to see a few dozen similar problems. You should contact the author of the script for his help. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062974 Share on other sites More sharing options...
indz Posted May 25, 2010 Author Share Posted May 25, 2010 Thanks again. As you said I got a new problem: Fatal error: Cannot use string offset as an array in C:\xampp\htdocs\cmms\lib\config.php(128) : eval()'d code on line 1 The author of the project is missing as this code was last updated in 2006. Can you please advise me on this problem. Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062979 Share on other sites More sharing options...
PFMaBiSmAd Posted May 25, 2010 Share Posted May 25, 2010 My recommendation would be to find a different, up to date, supported, script. In the time you will waste getting to the point where the current script will even run without any errors, then you will still need to determine if it meets your needs, you could search for, find, and evaluate 10 other scripts to find one that does what you want it to. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062981 Share on other sites More sharing options...
indz Posted May 25, 2010 Author Share Posted May 25, 2010 Thanks for the help and your time. But my supervisor wants me debug this code for my internship purpose. Can you please advise me on the above problem. Thanks a lot. Will try not to bug you anymore. FYI, please do checkout http://www.maintenance-software.org/cmms-screens.php for the screen shots of the system. It looks like it is working but when i try to run it....a lot of bugs are popping out. Quote Link to comment https://forums.phpfreaks.com/topic/202821-help-blank-page/#findComment-1062983 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.