Jump to content

Fatal error: Class 'Db' not found in /home/xxxx/public_html/config/alias.php on line 64


Recommended Posts

Hi english prestashop community
 
I need your help
 
Yesterday my server upgrades php from 5.2 to 5.4.25 and now received this error:
 
"Fatal error: Class 'Db' not found in /home/xxxx/public_html/config/alias.php on line 64"
 
I don't understand, before upgrade, I searched information in prestashop forums, all post said same, prestashop are compatible with php 5.4 or superior
 
My prestashop are 1.5.6.2
 
I have 24 hours with problem, server people says "this problem are your app problem"
 
info.php works (I check)
 
SQL it's ok (I check)
 
I'm desperate. I need your help
 
 
Thanks in advance from Spain
 
Carlos

 

Link to comment
Share on other sites

My guess is that when they upgraded your php, they dropped a module(s) required by PrestaShop.

 

you did not state if you had back office access but I suspect you have no access front or back.  ?

 

I would look to see if  pdo_mysql or similar module  (depends on fastcgi or apache module php)...is  loaded...

 

tip: create a subdomain and try an installation of prestashop, prestashop then see if any issues installing prestashoop


also just because you 'checked' the phpinfo(), you may also want to post a temporary link here for community review

Link to comment
Share on other sites

My guess is that when they upgraded your php, they dropped a module(s) required by PrestaShop.

 

you did not state if you had back office access but I suspect you have no access front or back.  ?

 

I would look to see if  pdo_mysql or similar module  (depends on fastcgi or apache module php)...is  loaded...

 

tip: create a subdomain and try an installation of prestashop, prestashop then see if any issues installing prestashoop

also just because you 'checked' the phpinfo(), you may also want to post a temporary link here for community review

 

 

Hi..!

 

MySQL works I check with mysqltest.php

 

And php check with info.php and works

 

 

Mi url: http://www.technospain.es

Edited by TechnoSpain (see edit history)
Link to comment
Share on other sites

Lets try a little test.  find this code in classes/db/Db.php  (line 217)

	public static function getClass()
	{
		$class = 'MySQL';
		if (PHP_VERSION_ID >= 50200 && extension_loaded('pdo_mysql'))
			$class = 'DbPDO';
		else if (extension_loaded('mysqli'))
			$class = 'DbMySQLi';
		return $class;
	}

add the following line just before return $class;

 

$class = 'MySQL';

 

in other words force class as MySQL...

	public static function getClass()
	{
		$class = 'MySQL';
		if (PHP_VERSION_ID >= 50200 && extension_loaded('pdo_mysql'))
			$class = 'DbPDO';
		else if (extension_loaded('mysqli'))
			$class = 'DbMySQLi';
		$class = 'MySQL';
		return $class;
	}



Dear Patron (this is a spanish name, jejeje)

 

Any advice about this problem?  :(  :(  :(

I live part time in Spain. :)

Link to comment
Share on other sites

Lets try a little test.  find this code in classes/db/Db.php  (line 217)

	public static function getClass()
	{
		$class = 'MySQL';
		if (PHP_VERSION_ID >= 50200 && extension_loaded('pdo_mysql'))
			$class = 'DbPDO';
		else if (extension_loaded('mysqli'))
			$class = 'DbMySQLi';
		return $class;
	}

add the following line just before return $class;

 

$class = 'MySQL';

 

in other words force class as MySQL...

	public static function getClass()
	{
		$class = 'MySQL';
		if (PHP_VERSION_ID >= 50200 && extension_loaded('pdo_mysql'))
			$class = 'DbPDO';
		else if (extension_loaded('mysqli'))
			$class = 'DbMySQLi';
		$class = 'MySQL';
		return $class;
	}


I live part time in Spain. :)

 

 

Go to work in server

Link to comment
Share on other sites

can you create a subdomain and do an install of ps?  use your ps version from here:

http://code.google.com/p/prestashop/downloads/list

 

I would like to see what if any issues the installer has with your php environment.  If it finds issues then it may be the same issue that is affecting your production shop.

 

 

Yes, I can, files are uploading while talking with you

Link to comment
Share on other sites

 

Dear Patron..
 
only a little off topic... 
 
In which province of Spain you live when you visit us?

 

 

http://en.wikipedia.org/wiki/Bembibre

 

but we have been all over (renfe) Spain.  I am happiest when only Spaniards in my town. :)

 

We are going to buy a piso S. City of Valencia.  But we love all of Spain  (well except where there are many drinking tourists).

 

I have pension visa in Spain and Colombia (Medellin). 

Link to comment
Share on other sites

how far along were you with your main shop?

 

I don't like to tell people to start over from scratch..but if not a lot of lost work...then maybe it a good idea

 

 

when you added subdomain was it as fastcgi or apache module?

 

check the broken domain to see if same (fast cti or apache module)

 

actually I think broken domaiin is running fastcgi...but if subomain is different that will be useful info

Link to comment
Share on other sites

how far along were you with your main shop?

 

I don't like to tell people to start over from scratch..but if not a lot of lost work...then maybe it a good idea

 

 

when you added subdomain was it as fastcgi or apache module?

 

check the broken domain to see if same (fast cti or apache module)

 

actually I think broken domaiin is running fastcgi...but if subomain is different that will be useful info

 

 

Store are all new, this monday finished, new prestashop (old are in 1.4.9.0) new theme, etc...

 

I have replaced all files in classes

 

New error...

 

Notice: Undefined index: ToolsCore in /home/xxxx/public_html/classes/Autoload.php on line 115

 

Warning: require(/home/xxxx/public_html): failed to open stream: File exists in /home/xxxx/public_html/classes/Autoload.php on line 115

 

Fatal error: require(): Failed opening required '/home/xxxx/public_html/' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/xxxx/public_html/classes/Autoload.php on line 115

Edited by TechnoSpain (see edit history)
Link to comment
Share on other sites

how far along were you with your main shop?

 

I don't like to tell people to start over from scratch..but if not a lot of lost work...then maybe it a good idea

 

 

when you added subdomain was it as fastcgi or apache module?

 

check the broken domain to see if same (fast cti or apache module)

 

actually I think broken domaiin is running fastcgi...but if subomain is different that will be useful info

 

 

Hi again

 

Domain broken :  

Server API

CGI/FastCGI

 

 

 

Subdomain:

 

Server API CGI/FastCGI
Link to comment
Share on other sites

in what way does the back office not work?

 

Hi Patron
 
I´m tried to connect to admin folder but not works
 
Always return one 404 mistake
 
 
 

Lo sentimos!

Página no disponible

Lo sentimos, la página no se encuentra disponible.

PARA BUSCAR UN ARTÍCULO, POR FAVOR, INDIQUE SU NOMBRE EN EL SIGUIENTE CAMPO:
Link to comment
Share on other sites

what a problem...I have never seen this...glad I could at least offer moral support...

 

tip: clean out your shop urls from post so it won't affect seo.

 

 

Yes, I think that all are cache problems, I clean again after up files from the copy  and now I have operative shop with php 5.4.25
 
About clean URL?  How do I do?
Link to comment
Share on other sites

  • 8 years later...

Hello from Barcelona!

I have had the same error. It's true, it's a cache problem.

I have deleted the file that El Patron said cache/class_index.php and everything is working again.

Thanks for this post, otherwise I wouldn't have been able to fix it.

Link to comment
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...