|
|
|
|
![]() ![]() |
Sep 18 2007, 05:33 AM
Post
#1
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 534 Joined: 31-January 05 From: Bucharest, Romania Member No.: 3,516 |
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! |
|
|
|
Sep 18 2007, 06:34 AM
Post
#2
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,153 Joined: 28-May 05 From: Devon, England Member No.: 7,593 ![]() |
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. |
|
|
|
Sep 18 2007, 10:17 AM
Post
#3
|
|
|
A computer once beat me at chess, but it was no match for me at kick boxing. ![]() Group: [MODERATOR] Posts: 4,085 Joined: 24-July 05 From: Linix, DOS and Windows…the good, the bad and the ugly Member No.: 9,787 ![]() |
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. |
|
|
|
Sep 18 2007, 12:13 PM
Post
#4
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 534 Joined: 31-January 05 From: Bucharest, Romania Member No.: 3,516 |
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) This post has been edited by adriantc: Sep 18 2007, 12:17 PM |
|
|
|
Sep 18 2007, 04:57 PM
Post
#5
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,153 Joined: 28-May 05 From: Devon, England Member No.: 7,593 ![]() |
Just for simplicity, here are the errors:
CODE 1: Warning: include() [function.include]: open_basedir restriction in effect. File(/vars.php) is not within the allowed path(s): (/home/adriantc/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/adriantc/public_html/index.php on line 3 2: Warning: include(/vars.php) [function.include]: failed to open stream: Operation not permitted in /home/adriantc/public_html/index.php on line 3 3: Warning: include() [function.include]: Failed opening '/vars.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/adriantc/public_html/index.php on line 3 4: Warning: include() [function.include]: open_basedir restriction in effect. File(/regmail.php) is not within the allowed path(s): (/home/adriantc/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/adriantc/public_html/index.php on line 4 5: Warning: include(/regmail.php) [function.include]: failed to open stream: Operation not permitted in /home/adriantc/public_html/index.php on line 4 6: Warning: include() [function.include]: Failed opening '/regmail.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/adriantc/public_html/index.php on line 4 7: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/adriantc/public_html/index.php on line 5 8: Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/adriantc/public_html/index.php on line 6 9: Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/adriantc/public_html/index.php on line 6 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. |
|
|
|
Sep 20 2007, 08:04 AM
Post
#6
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 534 Joined: 31-January 05 From: Bucharest, Romania Member No.: 3,516 |
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?
|
|
|
|
Sep 20 2007, 05:30 PM
Post
#7
|
|
|
Define:EVIL PROGRAMMER (ē'vəl prō'grăm'ər)- n. An organism that converts caffeine into evil software. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 1,074 Joined: 25-September 05 From: Los Angeles, California Member No.: 12,251 |
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: CODE @include'file.php';
|
|
|
|
Sep 20 2007, 05:57 PM
Post
#8
|
|
|
apt-get moo ![]() Group: [MODERATOR] Posts: 2,153 Joined: 28-May 05 From: Devon, England Member No.: 7,593 ![]() |
Personally I would actually put the following function at the very top of the page:
CODE 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. |
|
|
|
Sep 20 2007, 07:42 PM
Post
#9
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 534 Joined: 31-January 05 From: Bucharest, Romania Member No.: 3,516 |
Ok. Thank you everybody! I'll come back as soon as I will start fixing the problems!
|