Jump to content
xisto Community
adriantc

Problem With Php Or Sql

Recommended Posts

Hello! Some time ago (over 2 years) I used a script to make a website... In only customized a little the script and some more the HTML template. Over an year ago I noticed that something happened to the previously working website... tons and tons of PHP errors... Now keep in mind I haven't done any changes t the website for a long long time (had exams decisive for my life) and now I want to get back.Since I don't know much PHP I want to get the experts opinion on why this errors appeared out of nowhere!Thank you!

Share this post


Link to post
Share on other sites

Without knowing what the errors are, its very difficult to say what has gone wrong. However, if you are certain you haven't touched the script then the other possibility is a PHP upgrade. Some functions are removed in newer PHP versions, some have their parameters changed, all sorts of stuff goes on. It is possible that one function has been changed. That then snowballs and causes loads of other stuff to fail in your script, hence the mountain of errors.Also, if the script accesses a database, make sure it is using the correct username and password. If you changed those since you uploaded the script, then you need to give the script the new details.If that doesn't help, post the errors you get here, and I should be able to offer more precise help.

Share this post


Link to post
Share on other sites

I agree with rvalkass. The trap is now running php 5.2.0 and Mysql 5.0.27, both of which have had serious changes from 2 years ago. Get ready for php6 coming out soon. Very serious changes coming with that one. the option of running Safe Mode 'ON' is completely removed, apparently, which will do serious damage to older scripts which are programmed to be run under that.

Share this post


Link to post
Share on other sites

You can check the website from my signature for any errors. I'm sure you're both right so I guess it's hard now to find what function has changed. I wonder why don't they do PHP backwards compatible.I don't what to upgrade it or anything, I simply what it to work. I have begun programming on a new project... but it will take a while and meanwhile I need it to work!PS: This error emerged like 6-9 months ago without any changes whatsoever (no code changes, no password changes)

Edited by adriantc (see edit history)

Share this post


Link to post
Share on other sites

Just for simplicity, here are the errors:
 
The last 3 (errors 7, 8 and 9) are easy to fix. They show that you have passed no username, password or server name to a MySQL database connection. Make sure your script has the right username, password and server name in it. Also, make sure the function you use to connect to the database is still in the latest version of PHP. If not, replace it with the latest function and syntax.



Errors 1 to 6 refer to loading 2 external files. Firstly, make sure the two files (vars.php and regmail.php) still exist in the location the script is looking in. The error it comes up with (open_basedir) implies the script is trying to snoop around in locations it shouldn't be (such as other users accounts or system folders). Try changing the method you use to include those files to a simple include('filename.php'); . Again, that error could easily be caused by a PHP upgrade.



Share this post


Link to post
Share on other sites

Thank you for your help... I'll start figuring that out... By the way, can you tell me how I can stop the errors from appearing... as a temporal fix until I can check out every error?

Share this post


Link to post
Share on other sites

To stop php errors from occuring ad an @ symbol before each function that is giving you problems. Check the line numbers in the errors for seeing where to add them.

Example:

@include'file.php';

Share this post


Link to post
Share on other sites

Personally I would actually put the following function at the very top of the page:

error_reporting(0);

That will turn all errors off. When you want them tuned back on, either remove that line or replace the 0 with E_ALL to turn all errors back on.

Share this post


Link to post
Share on other sites

Ok. Thank you everybody! I'll come back as soon as I will start fixing the problems!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.