Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

MySQL error message

edited August 2009 in Vanilla 2.0 - 2.8
Hi there,

I just downloaded Vanilla 2 & Garden and tried to install on my webspace. So I changed the permissions correctley, created the config.php and navigated to the Garden folder, but there was an error:

"Fatal error: Undefined class constant 'MYSQL_ATTR_USE_BUFFERED_QUERY' in /home/www/.../garden/conf/config-defaults.php on line 17"

The Apache 2.2.11 server got PHP 5.2.10 and MySQL 5.1.36 (using phpMyAdmin 3.2.0.1). Can somebody help me?

Comments

  • Options
    SS ✭✭
    Seems that extensions pdo, pdo_mysql is not loaded for PHP on your "webspace".
  • Options
    MarkMark Vanilla Staff
    S might be right, but it could also be a PHP bug that I fixed over the weekend.

    First, make a phpinfo file and see if you have PDO enabled.

    If you do, grab the latest code from github and try installing again.
  • Options
    Uhm, pdo and pdo_sqlite are enabled, but apparently pdo_mysql isn't.
  • Options
    MarkMark Vanilla Staff
    Are you self-hosted? shared hosting?

    I'd contact support and see if they can enable it. More and more apps are using it. Seems silly they wouldn't have it enabled.
  • Options
    jbminnjbminn New
    edited October 2009
    Here's how to resolve that error; it is common, as PDO is not a typically installed PHP MySQL driver.

    1. Use PECL to install PDO & PDO_MYSQL

    a. pecl install PDO <-- only if PDO isn't already installed

    b. pecl install PDO_MYSQL

    2. Edit your php.ini to load the drivers

    a. add these lines to php.ini (assuming /etc/php.ini)

    extension_dir=/usr/lib/php/modules <--- this is where pecl installed the modules

    extension=pdo_mysql.so <---- this is the specific module name to load

    b. save the file; note the path it is in for use in Step 3.

    3. Ensure Apache starts up with the correct php.ini loaded; often it does not.

    a. in terminal, set the PHPRC var

    i). export PHPRC=/etc <--- this is used if you edited /etc/php.ini in Step 2. Path only!

    b. Start or restart Apache

    i). /etc/init.d/httpd restart <--- this may differ from distro to distro

    4. You should now have a running Apache instance with a properly configured PHP with PDO & PDO_MYSQL support
Sign In or Register to comment.