Fatal error class PDO not found
Posted by: hernandovil1 (---.cable.net.co)
Date: August 19, 2016 02:22AM

Hi, i installed wamp in new windows 10 and when i try to run a program thas uses PDO dll show me the error: Fatal error: Class 'PDO' not found in C:\Users\disof...
I try to fix the error modifying php.ini in the extension_dir, uncomment all php_mysql dlls, verified that PDO in php is running (php -m) and seems that everything is ok.
I installed the last version of wamp in windows 10 and the W is green.
Note: i have worked for many years with wamp with windows 7 wnd no problems.
Thank you for your help.
Best regards

Re: Fatal error class PDO not found
Posted by: RiggsFolly (Moderator)
Date: August 19, 2016 02:34AM

Remember there are 2 php.ini files.

To edit the one used by PHP under Apache use the menu links

wampmanager -> PHP -> php.ini


Maybe you edited the wrong php.ini, the one that is only used by PHP CLI

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Re: Fatal error class PDO not found
Posted by: Otomatic (Moderator)
Date: August 19, 2016 05:33PM

Hi,

> I try to fix the error modifying php.ini in the extension_dir, uncomment all php_mysql dlls,

Why make it simple when you can make it complicated !

It is very simple to load (or not) a PHP extension !

- Left-Click Wampmanager tray Icon -> PHP -> PHP extensions -> Check or uncheck needed extension

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Fatal error class PDO not found
Posted by: hernandovillamizar@gmail.com (---.cable.net.co)
Date: August 21, 2016 05:12PM

Hi, i used the write menu in wampmanager to change php.ini, i'm shure is the write php.ini, but still show me the same error class PDO not found, what else can i do? Something with the windows 10?

Re: Fatal error class PDO not found
Posted by: Otomatic (Moderator)
Date: August 21, 2016 06:38PM

Hi,

> i try to run a program thas uses PDO
What PDO?
PDO means PHP Data Objects. It is a generic name, you must know what class it is. It may be a Class PDO created by the application and not a PDO Class PHP.

> Fatal error: Class 'PDO' not found in C:\Users\disof...
Please put EXACT and COMPLETE error message.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Fatal error class PDO not found
Posted by: hernandovillamizar@gmail.com (---.cable.net.co)
Date: August 23, 2016 02:05AM

Hi, thank you for your help, here the exact error:
First:
Invalid json sent back from server. Error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Then:
Server sent: <br />
<b>Fatal error</b>: Class 'PDO' not found in <b>C:\wamp\www\ERP\DBC.php</b> on line <b>29</b><br />

Here DBC.php lines:

public static function get()
{
	if(self::$instance == null)
	{
		try
		{
			self::$instance = new PDO(
				'mysql:host='.self::$host
      .';dbname='.self::$db,
				self::$user,
				self::$pass,
				array(
					PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8",
					PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
					PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
				)
			);
		}
		catch(PDOException $e)
		{
			echo "Error!: " . $e->getMessage() . "<br/>";
			die();
		}
	}
	return self::$instance;
}

Thanks



Edited 2 time(s). Last edit at 08/23/2016 09:42AM by RiggsFolly.

Re: Fatal error class PDO not found
Posted by: Otomatic (Moderator)
Date: August 23, 2016 09:55AM

Hi,

> Note: i have worked for many years with wamp with windows 7 wnd no problems.

What versions Apache, PHP and MySQL do you use with Windows 10?

Are they the same versions as those you have with Windows 7?

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Re: Fatal error class PDO not found
Posted by: RiggsFolly (Moderator)
Date: August 23, 2016 09:55AM

Can you check that you have the php_pdo_mysql extension loaded

Using the wampmanager menus do

wampmanager -> PHP -> Php Extensions -> php_pdo_mysql

The php_pdo_mysql extension should have a green tick beside it

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Re: Fatal error class PDO not found
Posted by: hernandovillamizar@gmail.com (---.cable.net.co)
Date: August 26, 2016 02:20PM

No, write now i'm using the last one, i tried with both, the same as i installed in w7 and the latest and the error is the same

Re: Fatal error class PDO not found
Posted by: hernandovillamizar@gmail.com (---.cable.net.co)
Date: August 26, 2016 02:22PM

Yes there is the green tick in the php_pdo_mysql line...

Re: Fatal error class PDO not found
Posted by: RiggsFolly (Moderator)
Date: August 26, 2016 07:22PM

I suggest you fix the json error and then see if you still have the problem

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Sorry, only registered users may post in this forum.