Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

PHP Fatal error: Call to undefined method DB_error::query()

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
Repesorsa
Posts: 22
Joined: 2018-03-24 10:21

PHP Fatal error: Call to undefined method DB_error::query()

#1 Post by Repesorsa »

Hi,

I'm developing(not having a webserver) a site made with these many years ago in another computer:

WAMP stack
----------
Apache 2.4.9
PHP 5.5.12 + PEAR + DB(unfortunately I don't know the versions)
MySQL 5.6.17
The site has also Smarty in it.

Now my developing stack is this:

Ubuntu 14.04(LTS)
Apache 2.4.7
PHP 5.5.9
PEAR 1.9.4
DB 1.9.2

I've checked PHP is working and PEAR is working. But when I'm trying to see the pages I'm about to improve in the browser, the browser is empty and gives an error.

I do get this to Apache /var/log/apache2/error.log:

PHP Fatal error: Call to undefined method DB_error::query() in /usr/share/php/DB.php on line 986

Yee, I know: Use another addons, Composer for example. But situation is that I should make this Linux and with this platform. Versions I am able to change, nothing besides. By the way: how does Debian and PHP5 go together? Could it be better way to do this?

I've tried different version of DB, but it didn't help. Please help!

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1389
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 45 times
Been thanked: 66 times

Re: PHP Fatal error: Call to undefined method DB_error::quer

#2 Post by None1975 »

This is Debian user forum, not Ubuntu. Please, ask in a dedicated forum.
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

Repesorsa
Posts: 22
Joined: 2018-03-24 10:21

Re: PHP Fatal error: Call to undefined method DB_error::quer

#3 Post by Repesorsa »

I've allready asked. And there's a question in between about debian.

User avatar
None1975
df -h | participant
df -h | participant
Posts: 1389
Joined: 2015-11-29 18:23
Location: Russia, Kaliningrad
Has thanked: 45 times
Been thanked: 66 times

Re: PHP Fatal error: Call to undefined method DB_error::quer

#4 Post by None1975 »

Repesorsa wrote:I've allready asked. And there's a question in between about debian.
If you want to find out how Debian and PHP5 go together, you can read this.
OS: Debian 12.4 Bookworm / DE: Enlightenment
Debian Wiki | DontBreakDebian, My config files on github

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: PHP Fatal error: Call to undefined method DB_error::quer

#5 Post by GarryRicketson »

Actually, the distro or OS has very little to do with it,
PHP, errors are usually very straight forward, and even tell you what line, :

Code: Select all

PHP Fatal error: Call to undefined method DB_error::query() in /usr/share/php/DB.php on line 986 
[/url]
You can "click" where it says "code", and get all of the results.

And there usually are lot's of hits, with details,: Example: https://stackoverflow.com/questions/630 ... od-dbquery
==============
PHP 5.5.12 + PEAR + DB(unfortunately I don't know the versions)
You need to know the version, The wrong version, for your php version might not work at all, or would return a lot of errors.
By the way: how does Debian and PHP5 go together?
It depends on what version of Debian. The current stable version of Debian is using PHP7.
https://wiki.debian.org/PHP
Stretch 9
7.0.14-2
I use PHP5 on my Debian 7 (wheezy) server without any problems.

It does not look like the OP has done any searches on this, but then again maybe they did.
The best place to get help with PHP(anyversion) and Maria DB or Mysql , would be on their support forums and websites.
Yee, I know: Use another addons, Composer for example.
Never heard of composer, but no , you are wrong, using add ons and plugins
usually just complicate everything even more, and often lead to serious security issues.

Repesorsa
Posts: 22
Joined: 2018-03-24 10:21

Re: PHP Fatal error: Call to undefined method DB_error::quer

#6 Post by Repesorsa »

Ok, I found solution.

There is a DSN defining in a certain file called config.php and there's a line:

Code: Select all

define("DSN", 'mysql://root:password@localhost/[database_name]');
This [database_name] in my config.php -file was wrong. I changed it to correct name and the page started to work!
Could you believe that I fought with this for over three months? :oops:

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: PHP Fatal error: Call to undefined method DB_error::quer

#7 Post by GarryRicketson »

Yes, well 3 months seems a little long, but yes some times it can take some time to track down the error, even with the line numbers, etc.

That is good you found it

Post Reply