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

Need help with C, C++, perl, python, etc?

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

Postby Repesorsa » 2018-09-04 11:53

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!
Repesorsa
 
Posts: 22
Joined: 2018-03-24 10:21

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

Postby None1975 » 2018-09-04 12:20

This is Debian user forum, not Ubuntu. Please, ask in a dedicated forum.
OS: Debian 9.5 / WM: Xmonad
Debian Wiki | DontBreakDebian, My config files in github
Linux User #607425
User avatar
None1975
 
Posts: 668
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

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

Postby Repesorsa » 2018-09-04 12:39

I've allready asked. And there's a question in between about debian.
Repesorsa
 
Posts: 22
Joined: 2018-03-24 10:21

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

Postby None1975 » 2018-09-04 12:51

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 9.5 / WM: Xmonad
Debian Wiki | DontBreakDebian, My config files in github
Linux User #607425
User avatar
None1975
 
Posts: 668
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

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

Postby GarryRicketson » 2018-09-04 13:09

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

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/6307408/pdo-call-to-undefined-method-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.
User avatar
GarryRicketson
 
Posts: 5161
Joined: 2015-01-20 22:16
Location: Durango, Mexico

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

Postby Repesorsa » 2018-09-04 14:40

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:
Repesorsa
 
Posts: 22
Joined: 2018-03-24 10:21

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

Postby GarryRicketson » 2018-09-04 15:43

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
User avatar
GarryRicketson
 
Posts: 5161
Joined: 2015-01-20 22:16
Location: Durango, Mexico


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable
cron