View Full Version : Deconstructing a PHP and SQL site
09-18-2006, 07:43 PM
One of my users had a website developed by a relative that ran on php and SQL. I installed php and mysql on the users server so that the developer could access it and make whatever changes he needed to. Once it was done, I removed the developers access to the server. Recently the hard drive crashed and I replaced it. I got all the files from the server in my nightly backups, however the sql information and whatever other information the programmer changed was lost since only files were backed up and not settings. My user has severed the tie between him and the programmer for some unknown reason, so I can't get any help from him. Is there any way to deconstruct the website so I can find out what needs to be programmed? I don't know sql but I'd be down for learning it. I have the entire web directory but that's about it.
Thanks for any insight.
09-18-2006, 11:07 PM
What's the web site doing/not doing? In theory, if you really get all the db files from the file system, you should just be able to restore them, reset the permissions and off you go. Need more info about what's happening to help you though.
09-18-2006, 11:33 PM
i give 10 to 1 odds your just missing a database user. but yeah, like TS said, we'd need more info to help you. any PHP programmer worth his salt could diagnose in a couple of hours.
09-18-2006, 11:48 PM
Thanks for responding you guys. Some of the pages don't load on click. The site was designed so different MD's could change their CV's on their own. Mostly it's the profile pages that don't load.
Here is one error:
Warning: mysql_pconnect(): Access denied for user 'Administrator'@'localhost' (using password: NO) in /Library/WebServer/Documents/Connections/jrcMain.php on line 5
Fatal error: Access denied for user 'Administrator'@'localhost' (using password: NO) in /Library/WebServer/Documents/Connections/jrcMain.php on line 5
Does that sound like what you are saying?
09-19-2006, 12:03 AM
i'm no php guy, but on that one line alone, my guess is that the account for "administrator" has a password on the restored database.
looks like the program expects that db account to not have a password when it, in fact, does.
i don't know mySQL all that well either, but why would you (assuming i'm right) have a program connecting to a database as any sort of administrator? maybe that's why your guy severed ties with the programmer.
if you post the code from jrcMain.php i might could help a little more.
09-19-2006, 10:00 AM
What BI said. You need to create an account on the db server named "Administrator." Based on that error, its not expecting a password for the account, so you don't need to setup a password, although this is a *horrible* idea unless you restrict access to certain hosts and even then its not very good security.
The account being named "Administrator" is insignificant. The only full-privileged account on MySQL is root. All other accounts have to be created and can be named arbitrarily.
So you need to either setup an account named "Administrator" with no password, or create a new account with proper security restrictions and then modify each instance of the PHP function mysql_pconnect() so that it logs in with proper credentials. Documentation here (http://us2.php.net/manual/en/function.mysql-pconnect.php).
09-19-2006, 10:37 PM
Thanks you guys. I wasn't able to work on the server today but tomorrow I am going to format and reinstall the software from scratch. I hear what you are saying about the Administrator account. I will check to make sure that it is configured correctly (hopefully).
09-20-2006, 06:20 PM
Wow, its bad enough he's using an admin account with no pass, but the fact that the code is set to spit out error reports is horrible!
09-20-2006, 07:47 PM
I was looking at the php page in question and it had an Administrator password on it. I took it offline until I can figure out what is going on with this thing.
Powered by vBulletin® Version 4.1.12 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.