Migration of website... PHP/Mysql -which path for DB.php

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support Migration of website... PHP/Mysql -which path for DB.php
# 8  
Old 05-29-2012
Quote:
Originally Posted by Neo
There is no line numbers in the file above.

Would be good if you could post your code in a way which others can read the line numbers.
Quote:
Originally Posted by Neo
OK, Thanks!

I suggest you replace 'DB.php' with the full path.

What is the full path, BTW?

And what are the permissions for that file (output of ls -la)... ?

I've tried that with the full path (that I think it is), I listed a search for the full path and tried replacing it with several.

When I replace it with

require_once '/home/mywebsiteDirectory/public_html/include/DB/DB.php'

-for example... I get the not useful Pear error message

"DB Error: not found"

I've found this useful tutorial on the Pear DB library here

--- As an interesting sidenote -the ex-contractor who wrote this (who has since gone on to bigger and better things) used this method of connecting to our MySQL database only once. Elsewhere in the code (on completely separate pages) -he uses a different method. Perhaps he abandoned this method?

---------- Post updated at 10:18 AM ---------- Previous update was at 10:13 AM ----------

Quote:
Originally Posted by bakunin
There is an old saying that 90% of all Unix problems are permission problems. Did you check the file systems permissions and ownerships of the file(s) and made sure they match?

Just a suggestion.

I hope this helps.

bakunin

and
Quote:
And what are the permissions for that file (output of ls -la)... ?
Genius!!!

Of course the permissions weren't transferred when I moved the files between websites.
Code:
-bash-3.2$ ls -al ~/public_html/include/DB/DB.php
-rw-r--r-- 1 mywebsiteDirectory mywebsiteDirectory 38997 Apr 16 10:44 /home/mywebsiteDirectory/public_html/include/DB/DB.php

# 9  
Old 05-29-2012
That's why when you entered the full path it did not work.

First you must confirm you are actually using the file and then confirm what the access rights/permissions are.

It's really quite easy when you get the hang of it.
# 10  
Old 05-29-2012
Unfortunately it is still no dice.

I 'chmoded' the file in question so that it executes.

The error is the same.

"DB Error: not found"
# 11  
Old 05-29-2012
Well, if you don't post the output of ls -la of the file that shows the permissions, we can't easily help you.
# 12  
Old 05-29-2012
AH.. I see it it now... sorry.....

Quote:
-rw-r--r-- 1 mywebsiteDirectory mywebsiteDirectory 38997 Apr 16 10:44 /home/mywebsiteDirectory/public_html/include/DB/DB.php
It's readable.... so something else is missing somewhere.
# 13  
Old 05-29-2012
Quote:
Originally Posted by Neo
Well, if you don't post the output of ls -la of the file that shows the permissions, we can't easily help you.
I did it is above.
-bash-3.2$ ls -al ~/public_html/include/DB/DB.php -rw-r--r-- 1 mywebsiteDirectory mywebsiteDirectory 38997 Apr 16 10:44 /home/mywebsiteDirectory/public_html/include/DB/DB.php
But I accidentally solved this error.

Our customer service agent noticed that a tool that we use (where the page is hosted by our current website: website2) was pointing to the database on our old website; website1.

I looked at the code and found out that indeed the old IP address was hard coded in there.

When I changed that IP address to the new IP address -suddenly things work.

Very strange. Thanks to all.
# 14  
Old 05-29-2012
That issue would not cause an error on line 7.. so you missed something along the way.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Need a tracking PHP Script – “how long people stay on the website?”

I want to know, is there a way to track how long anyone has been logged into website and then insert it up for each time they have logged on. In case, user a logs in for 30 minutes, then later comes back and logs in for an hour, then later comes back and logs in for 50 minutes, Add... (1 Reply)
Discussion started by: AimyThomas
1 Replies

2. Programming

PHP and MySQL

Hello, While I was interpretation the PHP manual on database security the recent past, it said that you should by no means connect to the database as the super user but rather as one more user with more limited options. My question is: How do you generate new users and set access... (2 Replies)
Discussion started by: AimyThomas
2 Replies

3. Web Development

Request to check:PHP website design help

Hi I have a website name www.gentrepid.org I have all the setting scripts for this website in php now as a research part, I am new to this as I havent done that before. I have to make certain changes in the website Include some icons on the left like "Drugs" when user click on it... (0 Replies)
Discussion started by: manigrover
0 Replies

4. Shell Programming and Scripting

Mysql is not connected in php

Hi, The php is not able to connect into my mysql database. But i can able to connect by manually. I think that I have missed some points. Please guild for the same. Thanks, Mani (1 Reply)
Discussion started by: Mani_apr08
1 Replies

5. Programming

MySQL - PHP

Hello every one i have question i want to build DATAbase using PHP as interface i use shell to access to linux . i have in linux psql and SQLplus i'll call all html files that has db tabels from shell directory. what should to do before design php pages. can build the database sql design... (3 Replies)
Discussion started by: Scotch
3 Replies

6. Shell Programming and Scripting

Problem with PHP and MySQL

Okay, I'm new to this PHP and MySQL stuff, so help would be VERY much appreciated. :) On my iMac runnning Panther, it has MySQL and PHP installed. Yet when I view a PHP file from the iMac or another computer at my house, I get the source code. What's wrong? (11 Replies)
Discussion started by: Danny_10
11 Replies

7. UNIX for Dummies Questions & Answers

PHP and MySQL

I want to design a database, using mysql as a backend, and PHP as the frontend, I wanna be able to easily build forms in PHP to communicate with MySQL, is there any programs that will allow this, I really dont want to program all the forms by hand.. thankyou (2 Replies)
Discussion started by: kwalick
2 Replies

8. Shell Programming and Scripting

PHP: problem after login on website

I have a auction website i downloaded and when i log in as the admin, i get the following error whats wrong. the username and password are correct for the log in. Its trying to run another script called admin_catorgies_class.php . thats what i can see in the php script anyway. here the... (5 Replies)
Discussion started by: perleo
5 Replies

9. Cybersecurity

mysql php

with a limited knowledege of php and sql, what is a good and secure way to do passwords running an https server? (1 Reply)
Discussion started by: macdonto
1 Replies
Login or Register to Ask a Question