Zend Framework: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 08:56:25

This looks related to this bug on PHP's bugtracker : Bug #47224 MYSQL_ATTR_INIT_COMMAND is no longer available

It seems it's been fixed in SVN -- but maybe not in the version of PHP you are using ?


Quoting one of the comments :

[2009-07-02 06:43 UTC] mg at artigo dot pl
A temporary solution is to use INT value (1002) instead of constant.

This might be a temporary solution, until you install a new version of PHP, in which the bug is fixed ?

I just had the same error with PHP 5.2.6, and all I had to do is to open php.ini (e.g. on Windows: C:\Windows\php.ini, or on Ubuntu: /etc/php5/apache2/php.ini or sg. like this) in a text editor, and remove the semicolon from the following line:

;extension=php_pdo_mysql.dll

So as a result it would look like this in php.ini:

extension=php_pdo_mysql.dll

That solved my problem.

Looks like a Windows bug in PHP 5.3 that was fixed in SVN a while ago. You might want to try updating to the latest PHP release to see if the issue still exists.

I got the same error, on debian6, when I had not yet installed php-mysql so, I simply installed this, like this

apt-get install php5-mysql
/etc/init.d/apache2 restart

I just add it here, in case other have same problem, to save them them a few minutes of research.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!