PDO For WordPress – update

after nearly a year of absence i have updated PDO for WordPress to function with WP 2.7.1. In the same breath i have also changed many of the regex calls in the sqlite driver to use sqlite UDF’s (user defined functions) instead. there should be a measurable performance gain over previous versions.

the latest version is already available on wp.org.

141 Comments

kxfg35April 12th, 2009 at 9:53 am

Thank you very much for this plugin! My host charges me extra for MySQL databases, but not SQLite databases. Thank you for helping me save on hosting charges.

pratfallApril 18th, 2009 at 1:32 am

Hi,

It’d be nice if you updated the installation blurb on the plugin site to mention that the sqlite support expects to be able to write its database file to wp-content/database, and thus the webserver needs write access there.

Thanks!

JustinApril 18th, 2009 at 9:04 am

@pratfall:
the installation routine should inform you if it is not able to create the directory ‘database’ in wp-content and it should also inform you if it is not able to write to the new directory. it attempts to create both with 0777 permissions (and then protects the directory with .htaccess). See lines 73-87 of PDOEngine.php.
to be honest if users are unfamiliar with debugging and perms etc then changing the back-end of a tool like WP is _not_ a good idea at all. there are too many plugins etc that can break the query transformations and if you are not properly experienced then all you’re going to see is something between a blank screen and a screen of garbage.
that said, for those that wish to take the risk there is no harm in pointing out the obvious in the readme file.

Francis MaileApril 20th, 2009 at 1:40 am

What am I doing wrong?

WordPress
Invalid or missing PDO Driver

Your PHP installation appears not to have the right PDO drivers loaded. These are required for this version of WordPress and the type of database you have specified.

PDO
PDO support enabled
PDO drivers sqlite2, sqlite, mysql

pdo_mysql
PDO Driver for MySQL, client library version 5.0.16

pdo_sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.3 2007/12/31 07:20:10 sebastian Exp $
SQLite Library 3.3.7

JustinApril 20th, 2009 at 9:42 am

@Francis Maile:
can you run this code on your php server and post back the response

<?php
print_r(PDO::getAvailableDrivers());
?>
Bryce NewallApril 20th, 2009 at 9:09 pm

Greetings!
I’m having trouble getting PDO working under WordPress 2.7.1. I made the required changes to wp-config.php (I’m not a PHP expert, by the way), but when I try to bring up my site, instead of attempting to create the database, or even showing me a message saying it couldn’t create the database, I get this:

Fatal error: Call to a member function bail() on a non-object in /home/smacsdb/www/wp-content/pdo/PDOEngine.php on line 77

I looked at line 77 of that php file, and it appears to be calling that “bail” routing, possibly because it couldn’t create the database. That I can probably fix, but I’m wondering about the actual error message I’m getting?

Thanks!

JustinApril 20th, 2009 at 10:03 pm

@Bryce Newall:

Hi bryce
What version of the plugin are you using?

Bryce NewallApril 21st, 2009 at 12:20 am

I downloaded version 2.0.0, the latest one on the WP web site.

JustinApril 21st, 2009 at 10:12 am

@Bryce Newall:
ok.
the issue is that $wpdb is not made global in the connect method. i will upload a version 2.1.0 in the next few minutes.

but this is only a symptom of your issue, rather than the cure. the issue you have is that the plugin cannot create the necessary folder for your database (wp-content/database) due to permissions problems.

Francis MaileApril 21st, 2009 at 7:43 pm

can you run this code on your php server and post back the response

print_r(PDO::getAvailableDrivers());

I get this output:
Array ( [0] => sqlite2 [1] => sqlite [2] => mysql )

JimApril 21st, 2009 at 10:48 pm

I cant get past “Your PHP installation appears to be missing the PDO extension which is required for this version of WordPress.”

If I try print_r(PDO::getAvailableDrivers()); I get an error saying PDO class not found.

Using PHP 5.0.5

Any ideas?

JustinApril 21st, 2009 at 11:12 pm

@Jim:
I assume that you do have pro-sqlite installed? The error received suggests that you do not and that additionally you have not installed the pdo base library. Look at http://www.php.net/pdo for installation instructions.

JimApril 22nd, 2009 at 9:57 am

Hi Justin, sqlite is installed, but you are correct. I realised my php install does not have pdo support. I’m not likely to get it either as the server I’m using for this is a discreet NAS device (Thecis N2100) which i am unable to compile code for, so getting the pdo.so isnt an option and neither is upgrading my version of php. Thanks anyway.

JustinApril 22nd, 2009 at 10:09 am

@Jim:
surely you should be able to install PDO to a thecus box. although i don’t have one to check on.

do you have terminal and root access? is PECL installed? can you compile on the thecus? otherwise you can get the appropriate cross-compiler toolchain and rebuild the php binary on another machine.

JustinApril 22nd, 2009 at 10:23 am

@Francis Maile:
Hi Francis

the error message you get is from line 73 of wp-content/db.php (in version 2.1.0). it means that the driver that you have _requested_ is not loaded. it takes the request from your DB_TYPE definition in wp-config.php. this is not case sensitive btw but elsewhere there is case sensitivity so please make sure you use lower case.

so, please check carefully your wp-config.php file and make sure that DB_TYPE and its definition is spelled correctly.

From the installation notes in the readme file you should see:
—– wp-config.php —–
this line of code is placed directly after the define(‘COLLATE’,”); line:

define(‘DB_TYPE’, ‘sqlite’); //mysql or sqlite
—–

MichaelApril 25th, 2009 at 5:15 pm

hi Justin
I tried, but i got an error:
Your PHP installation appears to be missing the MySQL which is required for WordPress.
i run this code
print_r(PDO::getAvailableDrivers());
then response
Array ( [0] => sqlite2 )

Something i’m missing out?
I’m a chinese user,so english not very well ~~
Thank you very much!

JustinApril 25th, 2009 at 6:05 pm

@Michael: Hi

i am quite sure that your english is better than my chinese…

the error message you post is not one of mine (see lines 65-75 of wp-content/db.php).

however i can see from the response to PDO::getAvailableDrivers that you have the pdo extension loaded but do not have the sqlite3 extension loaded (which is a requirement). please see http://www.php.net/pdo for instructions on how to install the PDO drivers for your server type.

MichaelApril 26th, 2009 at 11:39 am

It works!
Thank you!

CraigApril 29th, 2009 at 4:51 am

Hi there…just so you know, something got garbled with your latest release to the wp plugins site:

* Clicking the download button is the only way to get something called version 2.1.0, but that zip file has a db.php and readme file and nothing else (no pdo dir or anything in it)
* If you click on the “download other versions”, you can get 2.0.0, but attempting to use the 2.1.0 db.php with 2.0.0 generates a lot of errors.

I just downloaded 2.1.0, and it took like a half hour before I could figure out I was missing like half of the plugin. I went to 2.0.0 and everything seems to work great. Thanks!

JustinApril 29th, 2009 at 8:39 am

@Craig:
Thanks. I will check it out soon as possible.

JustinApril 29th, 2009 at 1:52 pm

@Craig:
this is fixed now. it may take a half-hour or so for the svn rescan on WP to happen.

GilzowApril 29th, 2009 at 9:56 pm

Looks like it still is messed up over at wp. I downloaded what is labeled as v2.2.0, but it is missing the file PDOEngine.php. I was able to go back to version 2.0.0 and extract that file.

WordPress v2.7.1
PHP 5.1.6
PDO drivers mysql, odbc, pgsql, sqlite

It also appears that this plugin is incompatible with PHP5 < 5.2.0 as you are using preg_last_error() in pdo_sqlite_driver_create. Since it appears that you are using this simply for debugging, I went ahead and commented that line to see if I can get it to work with PHP5.1.6 (the standard for RHEL5). It created the MyBlog.sqlite and .htaccess files, but appears to not have been able to create the tables as it errors at step 2 when it attempts to prepare a statement that selects from wp_options (since there is no table wp_options yet). I see that commenter Michael ran into this exact same issue on February 2nd, 2009. Can you share what the solution was for him?

Also, I’d be interested in helping to develop an Oracle driver as that is what i /really/ need to use (sqlite is a stop-gap solution).

JustinApril 29th, 2009 at 10:01 pm

@Gilzow:
darn darn darn…. i can’t work out why the svn commit isn’t taking. My client is reporting that all is tickity boo… I will investigate.

In the meantime I have sent you the archive by mail. I suspect that the problem you have relates to an older version of the plugin as the recent versions have resolved the commented issue.

I regret that i know nothing about oracle’s sql language. That said, i’m happy to work on it with you.

JustinApril 29th, 2009 at 10:11 pm

@Gilzow:
oh yes, and the preg_last_error is just for debugging, as you said.

GilzowApril 30th, 2009 at 2:52 pm

Just wanted to say “THANK YOU” to justin for his assistance. We were able to get everything working. In my specific case, I had to chmod wp-contents to 777 temporarily for it to install successfully. Afterwards I was able to change it back to 775 and it is working fine.

D_MannMay 1st, 2009 at 7:10 am

When I run WP and the PDO Sqlite plugin nothing appears on the screen.

If I modify the wp-config.php and remove define(‘DB_TYPE’, ‘sqlite’); I receive the following message – Invalid or missing PDO Driver Your PHP installation appears not to have the right PDO drivers loaded. These are required for this version of WordPress and the type of database you have specified.

Here is my configuration:
PHP 5.2.9
Array ( [0] => odbc [1] => sqlite )

I am running the old version of your PDO Sqlite plugin on a number of sites on the same server without issue.

Thanks.

JustinMay 1st, 2009 at 9:01 am

@D_Mann:

the error you get is because DB_TYPE needs to be defined in order to work with my code. and my code is triggered simply by putting db.php into wp-content. in db.php there is a test for whether the PDO_Extension called DB_TYPE is installed. if DB_TYPE is blank/undefined the code looks for a PDO_Extension that is blank. Since there is none, you get the error.

there was a bug that crept in at some version which killed installation. the bug was fixed in version 2.0.0 and 2.2.0 (at wp.org). if you have previously had the error you need to delete wp-content/database prior to reattempting the install. I will improve this flow in a later release.

FeryMay 2nd, 2009 at 12:58 pm

Hi,

C:\Documents and Settings\processor>php -r print_r(PDO::getAvailableDrivers());
Array
(
[0] => sqlite
[1] => sqlite2
)

C:\Documents and Settings\processor>php-cgi -v
PHP 5.2.9-2 (cgi-fcgi) (built: Apr 9 2009 08:23:17)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

PDO plugins v2.2.0 installed on wp-content
define(‘DB_COLLATE’, ”);
define(‘DB_TYPE’, ‘sqlite’);

all requirement done,

define(‘DB_NAME’, ‘wp271.db’);
define(‘DB_USER’, ‘wp271user’);
define(‘DB_PASSWORD’, ‘wp271pass’);

as i want to use sqlite db backend.

that db file already created manually on root / directory
but seem wp can’t find the db for modification or creating table

any help would be appreciated.

Thanks.

JustinMay 2nd, 2009 at 5:31 pm

@Fery: i don’t recommend creating the database file manually. Let SQLite do all the work to guarantee a clean file creation.

i have updated the plugin to version 2.3.0 and posted it on WP.org. Please upgrade to the new version and see whether that helps – i have changed slightly the way that the installation works.

oursoloMay 2nd, 2009 at 9:22 pm

about v2.3.0
————————-
Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_terms ( term_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , name text NOT NULL default ”, slug text NOT NULL default ”, term_group integer NOT NULL default 0) ; CREATE UNIQUE INDEX IF NOT EXISTS slug_37 on wp_terms (slug); CREATE INDEX IF NOT EXISTS name_25 on wp_terms (name).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_term_taxonomy ( term_taxonomy_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , term_id integer NOT NULL default 0, taxonomy text NOT NULL default ”, description text NOT NULL, parent integer NOT NULL default 0, count integer NOT NULL default 0) ; CREATE UNIQUE INDEX IF NOT EXISTS term_id_taxonomy_44 on wp_term_taxonomy (term_id,taxonomy).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_term_relationships ( object_id integer NOT NULL default 0, term_taxonomy_id integer NOT NULL default 0, term_order integer NOT NULL default 0, PRIMARY KEY (object_id,term_taxonomy_id) ) ; CREATE INDEX IF NOT EXISTS term_taxonomy_id_41 on wp_term_relationships (term_taxonomy_id).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_comments ( comment_ID integer NOT NULL PRIMARY KEY AUTOINCREMENT , comment_post_ID integer NOT NULL default ’0′, comment_author blob NOT NULL, comment_author_email text NOT NULL default ”, comment_author_url text NOT NULL default ”, comment_author_IP text NOT NULL default ”, comment_date text NOT NULL default ’0000-00-00 00:00:00′, comment_date_gmt text NOT NULL default ’0000-00-00 00:00:00′, comment_content text NOT NULL, comment_karma integer NOT NULL default ’0′, comment_approved text NOT NULL default ’1′, comment_agent text NOT NULL default ”, comment_type text NOT NULL default ”, comment_parent integer NOT NULL default ’0′, user_id integer NOT NULL default ’0′) ; CREATE INDEX IF NOT EXISTS comment_approved_19 on wp_comments (comment_approved); CREATE INDEX IF NOT EXISTS comment_post_ID_21 on wp_comments (comment_post_ID); CREATE INDEX IF NOT EXISTS comment_approved_date_gmt_26 on wp_comments (comment_approved,comment_date_gmt); CREATE INDEX IF NOT EXISTS comment_date_gmt_25 on wp_comments (comment_date_gmt).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_links ( link_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , link_url text NOT NULL default ”, link_name text NOT NULL default ”, link_image text NOT NULL default ”, link_target text NOT NULL default ”, link_category integer NOT NULL default ’0′, link_description text NOT NULL default ”, link_visible text NOT NULL default ‘Y’, link_owner integer NOT NULL default ’1′, link_rating integer NOT NULL default ’0′, link_updated text NOT NULL default ’0000-00-00 00:00:00′, link_rel text NOT NULL default ”, link_notes text NOT NULL, link_rss text NOT NULL default ”) ; CREATE INDEX IF NOT EXISTS link_category_33 on wp_links (link_category); CREATE INDEX IF NOT EXISTS link_visible_7 on wp_links (link_visible).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_options ( option_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , blog_id integer NOT NULL default ’0′, option_name text NOT NULL default ”, option_value text NOT NULL, autoload text NOT NULL default ‘yes’) ; CREATE INDEX IF NOT EXISTS option_name_16 on wp_options (option_name).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_postmeta ( meta_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , post_id integer NOT NULL default ’0′, meta_key text default NULL, meta_value text ) ; CREATE INDEX IF NOT EXISTS post_id_42 on wp_postmeta (post_id); CREATE INDEX IF NOT EXISTS meta_key_23 on wp_postmeta (meta_key).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_posts ( ID integer NOT NULL PRIMARY KEY AUTOINCREMENT , post_author integer NOT NULL default ’0′, post_date text NOT NULL default ’0000-00-00 00:00:00′, post_date_gmt text NOT NULL default ’0000-00-00 00:00:00′, post_content text NOT NULL, post_title text NOT NULL, post_category integer NOT NULL default ’0′, post_excerpt text NOT NULL, post_status text NOT NULL default ‘publish’, comment_status text NOT NULL default ‘open’, ping_status text NOT NULL default ‘open’, post_password text NOT NULL default ”, post_name text NOT NULL default ”, to_ping text NOT NULL, pinged text NOT NULL, post_modified text NOT NULL default ’0000-00-00 00:00:00′, post_modified_gmt text NOT NULL default ’0000-00-00 00:00:00′, post_content_filtered text NOT NULL, post_parent integer NOT NULL default ’0′, guid text NOT NULL default ”, menu_order integer NOT NULL default ’0′, post_type text NOT NULL default ‘post’, post_mime_type text NOT NULL default ”, comment_count integer NOT NULL default ’0′) ; CREATE INDEX IF NOT EXISTS post_name_24 on wp_posts (post_name); CREATE INDEX IF NOT EXISTS type_status_date_4 on wp_posts (post_type,post_status,post_date,ID).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_users ( ID integer NOT NULL PRIMARY KEY AUTOINCREMENT , user_login text NOT NULL default ”, user_pass text NOT NULL default ”, user_nicename text NOT NULL default ”, user_email text NOT NULL default ”, user_url text NOT NULL default ”, user_registered text NOT NULL default ’0000-00-00 00:00:00′, user_activation_key text NOT NULL default ”, user_status integer NOT NULL default ’0′, display_name text NOT NULL default ”) ; CREATE INDEX IF NOT EXISTS user_login_key_4 on wp_users (user_login); CREATE INDEX IF NOT EXISTS user_nicename_17 on wp_users (user_nicename).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_usermeta ( umeta_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , user_id integer NOT NULL default ’0′, meta_key text default NULL, meta_value text ) ; CREATE INDEX IF NOT EXISTS user_id_15 on wp_usermeta (user_id); CREATE INDEX IF NOT EXISTS meta_key_14 on wp_usermeta (meta_key).
Error message was: Array ( [0] => HY000 [1] => 6 [2] => database table is locked )
———————–
that’s the error info in the head of every page
———————
when install WordPress 2.6.5 en final
——————
ps : if the permalinks setting is :

/%year%%day%/%post_id%.html or

/%year%%monthnum%/%post_id%.html (whit day or month)

all of the post pages will be “404″
———————
hope hope hope ~~~ your fix ~~~~ the very very good plugins~~~

来自中国用户的期待 和感谢

JustinMay 3rd, 2009 at 9:59 am

@oursolo:
well spotted!
that’s a fairly major error to get through testing unscathed!
i have uploaded a bug-fix to WP.Org as version 2.4.0. please redownload from there. It may take half an hour or so to be refreshed by the svn parsing software.

oursoloMay 3rd, 2009 at 11:50 am

about v2.4.0

tested , v2.3.0 ‘s bug have fixed in 2.4.0, so quickly ~ !

but there is a new problem in v2.4.0

————————-

after install, post some artical

if open the ” Permalinks ”

then into the “Edit Post or Manage Posts” ,there show “No posts found.”

and in the index page of the web ,page show ” no found ”

———

if open the ” Permalinks ”

some times, can’t post new artical, return page “Your attempt to edit this post: “sadfs Write PostWrite Post” has failed.Please try again.

but some times, can publish …..
——–

under WordPress 2.6.5 en final & 2.7.1

——-
hope for your fix , extremely grateful to you!!

JustinMay 3rd, 2009 at 1:21 pm

@oursolo:

What permalink structures are you using ?

FeryMay 3rd, 2009 at 1:22 pm

Using v2.4.0 still the same
looks like db create process lost somewhere
no database folder created
no MyBlog.sqlite db created

no error on php error_log
if i add fastcgi option with -s, the browser show the code of “wordpress/index.php”

or i still miss something on webserver config, but if i call test.php with phpinfo(); on it , the page is fine as expected

Thank you.

oursoloMay 3rd, 2009 at 1:56 pm

re:

Justin

What permalink structures are you using ?

————————–

before v2.3.0, set permalink with “%day% or %monthnum% ” will be 404 error

demo:
/%year%%day%/%post_id%.html or

/%year%%monthnum%/%post_id%.html

but ,if only use “%year% , just like “/%year%/%post_id%.html” , run well , no 404

in v2.4.0 use permalink by any setting, will be 404 error

JustinMay 3rd, 2009 at 7:18 pm

@Fery:
not sure what could be wrong, I’m afraid. it installs fine on my machine.
if you want me to debug further i’m happy to look at your machine but you will need to supply remote access credentials. Don’t post them publicly (of course!), ping them to me at justin.adie@gmail.com

hiroMay 4th, 2009 at 3:30 pm

When I replaced PDO from 1.0.2 to 2.4.0, any post is not displayed. It seems PDO try to create tables. I think SQL in the line 100 of PDOEngine.php should be ‘select count(*) from SQLite_Master’.

JustinMay 4th, 2009 at 3:47 pm

@hiro: you are right. I noticed this earlier today. I have been having issues with the svn upload and I think an early debut version got uploaded. I will take a look this evening

JustinMay 4th, 2009 at 9:11 pm

hiro, oursolo
thank you for pointing out these issues. I think they were, in fact, the same thing.
i very much hope that i have now fixed these problems and we have a stable version of PDO For WordPress once more. Version 2.5.0 was uploaded to wp.org about 10 minutes ago. It should be available for download in the next half-hour.
Please do post back with your experiences with the new version. This time, date based permalinks should also work.

oursoloMay 5th, 2009 at 5:59 pm

about v2.5.0

still the same problem about the permalink

————————-

if set permalink with “%day% or %monthnum% or %hour% or….. ” ,the postview pages will be 404 error

test demo:

/%day%/%post_id%.html or

/%monthnum%/%post_id%.html

still the same ,only use “%year% , just like “/%year%/%post_id%.html” , run well , no 404

—————

for test the URL rewrite & .htaccess , i change db to mysql, then the permalink run well , no problem ,so i guess , the sever’s system should be ok ?

oursoloMay 5th, 2009 at 6:08 pm

Justin ,don’t have too much pressure, take your time~~~ hehe~~ thank you one more time~~

JustinMay 5th, 2009 at 6:34 pm

@oursolo:
that’s strange – it’s working on my test server. i will investigate further tomorrow.

hiroMay 6th, 2009 at 12:02 pm

v2.5.0 works fine and succeeded to upgrade WP to 2.7.1. Thank you !

FeryMay 6th, 2009 at 1:32 pm

It’s on Windows from the beginning
using v2.5.0

after i switch webserver from nginx-for-win to abyss-for-win now php.log contain many error :)

[05-May-2009 21:30:05] PHP Notice: Use of undefined constant DB_TYPE – assumed ‘DB_TYPE’ in D:\Abyss\htdocs\wp-content\db.php on line 73
[05-May-2009 21:36:28] PHP Notice: Use of undefined constant ABSPATH – assumed ‘ABSPATH’ in D:\Abyss\htdocs\wp-content\db.php on line 134
[05-May-2009 21:36:28] PHP Notice: Use of undefined constant ABSPATH – assumed ‘ABSPATH’ in D:\Abyss\htdocs\wp-content\db.php on line 135
[06-May-2009 19:12:49] PHP Notice: Use of undefined constant DB_USER – assumed ‘DB_USER’ in D:\AbyssX225\htdocs\wp-content\pdo\db.php on line 234
[06-May-2009 19:12:49] PHP Notice: Use of undefined constant DB_PASSWORD – assumed ‘DB_PASSWORD’ in D:\AbyssX225\htdocs\wp-content\pdo\db.php on line 234
[06-May-2009 19:12:49] PHP Notice: Use of undefined constant DB_NAME – assumed ‘DB_NAME’ in D:\AbyssX225\htdocs\wp-content\pdo\db.php on line 234
[06-May-2009 19:12:49] PHP Notice: Use of undefined constant DB_HOST – assumed ‘DB_HOST’ in D:\AbyssX225\htdocs\wp-content\pdo\db.php on line 234
[06-May-2009 19:12:49] PHP Notice: Use of undefined constant DB_TYPE – assumed ‘DB_TYPE’ in D:\AbyssX225\htdocs\wp-content\pdo\db.php on line 234

[06-May-2009 19:08:03] PHP Notice: Use of undefined constant DB_USER – assumed ‘DB_USER’ in D:\AbyssX225\htdocs\wp-includes\wp-db.php on line 992
[06-May-2009 19:08:03] PHP Notice: Use of undefined constant DB_PASSWORD – assumed ‘DB_PASSWORD’ in D:\AbyssX225\htdocs\wp-includes\wp-db.php on line 992
[06-May-2009 19:08:03] PHP Notice: Use of undefined constant DB_NAME – assumed ‘DB_NAME’ in D:\AbyssX225\htdocs\wp-includes\wp-db.php on line 992
[06-May-2009 19:08:03] PHP Notice: Use of undefined constant DB_HOST – assumed ‘DB_HOST’ in D:\AbyssX225\htdocs\wp-includes\wp-db.php on line 992
[06-May-2009 19:14:23] PHP Notice: Use of undefined constant ABSPATH – assumed ‘ABSPATH’ in D:\AbyssX225\htdocs\wp-content\pdo\driver_sqlite\schema.php on line 16

[06-May-2009 19:14:23] PHP Notice: Undefined variable: wp_version in D:\AbyssX225\htdocs\wp-content\db.php on line 146

after every variable i change to real /path/to/expected everything just fine

Thanks afterall ^^

JustinMay 6th, 2009 at 1:51 pm

@Fery:

Those errors indicate that you have not defined DB_TYPE in wp_config.php as per the install instructions.

PeterMay 13th, 2009 at 1:41 am

Got a blank page with status 500. Running under spawn-fcgi. PHP error log is empty.

When changing pdo/db.php:37 to this:
global $wpdb; $wpdb = 1;
the blank page changes to a long screen of sql-related errors like this:
«Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_terms ( term_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , name text NOT NULL default ”, slug text NOT NULL default ”, term_group integer NOT NULL default 0) ; CREATE UNIQUE INDEX IF NOT EXISTS slug_13 on wp_terms (slug); CREATE INDEX IF NOT EXISTS name_38 on wp_terms (name).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error )»

JustinMay 13th, 2009 at 7:58 am

@Peter:

Can you let me know what version of the plugin and wp you are using please.

PeterMay 13th, 2009 at 11:42 am

With a pleasure — I like debugging :)

Plugin 2.5.0
WP 2.7.1
PHP 5.2.4
print_r(PDO::getAvailableDrivers()); -> Array([0] => sqlite)

If it helps: Ubuntu 8.04.2, on kernel 2.6.18, on VPS (OpenVZ) ;)

JustinMay 13th, 2009 at 1:06 pm

@Peter:
that’s curious. i thought all the installation bugs had been ironed out now.
could you try renaming the database directory (say database_old) and trying to install again?

PeterMay 13th, 2009 at 9:45 pm

I’v renamed the db directory and ran the installation, but with the same result.

I think, the problem may be in my php installation. I’m a novice in php-based applications, so all the software may have been installed in a wrong way. What steps could I take to get the right php environment (with pdo, pdo_sqlite) on a modern linux?

Thanks a lot for your help :)

JustinMay 13th, 2009 at 9:53 pm

@Peter:
Occams razor suggests that the plugin is at fault. but i suspect it’s more the unfamiliar (to me) method of using php and the resulting permissions issues.
please try creating the directory ‘wp-content/database’ by hand and expressly setting the perms to 0777 on the directory and all inheritors.
then re-run the plugin.
good luck !

PeterMay 13th, 2009 at 10:48 pm

Nothing changed :(

That was already set to 777. I have only two users on my vps: “www” and “root”. All turns was done under “www” one. It creates ok the zero-sized MyBlog.sqlite file (and the .htaccess too).

May be I have different version of sqlite?
Error messages are strange because of “near “NOT”: syntax error”. How can I check the version of installed sqlite engine?

Adam BaronMay 27th, 2009 at 2:45 pm

Hello,

I have installed your plugin and wordpress on fresh system. I have modified wp-config.php. But when I run install I see empty page. I have made some searching and found out the script last processed is db.php. It probably stops on line require_once PDODIR.’db.php’;.
The directory called is /mnt/www/www/wordpress//wp-content/pdo/db.php I wonder why the script is calling itself, and why is the direcory with two //.

Could you look on this problem?

Adam

Adam BaronMay 27th, 2009 at 3:08 pm

Well, I found the mistake in define statement in db.php and next was called another /pdo/db.php. It calls /wp-includes/wp-db.php. There it stops.

Adam

JustinMay 27th, 2009 at 3:11 pm

@Adam Baron:
there is no error there.

what version of wordpress are you using? and what version of the plugin?
i have had some problems with the svn upload to wordpress.org and it may be that the upload is still corrupted or that the wrong versions of the files are being made available.

Adam BaronMay 27th, 2009 at 3:57 pm

I have downloaded form web:
wordpress latest 2.7.1
pdo for wordpress 2.5.0

HericMay 28th, 2009 at 1:54 pm

im getting this error:
“Invalid or missing PDO Driver”
i’m using the last version of wordpress and pdo

and.. print_r(PDO::getAvailableDrivers()); gimme it:
Array ( [0] => mysql [1] => pgsql )

[off] in wp-config.php, the login, pass and host name are required or i can delete it?

JustinMay 28th, 2009 at 2:00 pm

@Heric:
this simply means that you don’t have the sqlite driver for PDO installed. have a look at the php manual for how to install it. assuming you are using linux the easiest way is to use PECL

HericMay 28th, 2009 at 2:07 pm

i think is a problem with permisson, because in localhost it works, what archives i need to change permisson?

… let me try, if the host dont have support for pdo i will do a suicide >.>

JustinMay 28th, 2009 at 2:10 pm

@Heric:
It is nothing to do with permissions. the error is only displayed if you do not have the right PDO extension loaded.

Edward de LeauMay 30th, 2009 at 1:09 am

Pretty interesting project! I really would like this to work on my synology cs407. I ipkg-ed a lighttpd on it and php

I get the “Invalid or missing PDO Driver” error and the line as above + Array ( [0] => sqlite2 [1] => sqlite ) + define(‘DB_COLLATE’, ”); define(‘DB_TYPE’, ‘sqlite’); //mysql or sqlite

So … hmmm.. what did I miss… probably something stupid

Edward de LeauMay 30th, 2009 at 1:20 am

ok… so i disabled one of the sqlite extension and it runs through… now…. a blank screen! exciting!

Edward de LeauMay 30th, 2009 at 1:35 am

hmmm it fails on require_once ABSPATH.’wp-includes/wp-db.php’;

Edward de LeauMay 30th, 2009 at 2:15 am

So i commented the $wpdb line in wp_db and now it generates such a huge amount of errors… but it creates a “MyBlog.sqlite”. it boils down to “Error occurred at line 350 in Function prepareQuery.
Error message was: Problem preparing the PDO SQL Statement. Error was Array ( [0] => HY000 [1] => 1 [2] => near “,”: syntax error ) “

JustinJune 1st, 2009 at 1:18 pm

@Edward de Leau:
this is an issue with wp 2.8.0 and the change in database inserts that is used during the install process.

i have written a fix which i will upload later today.

Edward de LeauJune 1st, 2009 at 2:07 pm

Thanks Justin!

Edward de LeauJune 1st, 2009 at 5:20 pm

It works perfectly Justin, thanks very much!

JustinJune 1st, 2009 at 6:57 pm

@Edward de Leau:
no worries.

Joshua HuberJune 2nd, 2009 at 2:28 am

I’ve run into some problems with the pluggin install. When I follow the standard install instructions I get the following error:

Mon Jun 01 21:07:33 2009] [error] [client 192.168.10.11] PHP Fatal error: Uncaught exception ‘PDOException’ with message ‘SQLSTATE[HY000] [14] unable to open database file’ in /export/home/jlhuber/httpd/blog/wp-content/pdo/PDOEngine.php:111\nStack trace:\n#0 /export/home/jlhuber/httpd/blog/wp-content/pdo/PDOEngine.php(111): PDO->__construct(‘sqlite:/export/…’)\n#1 /export/home/jlhuber/httpd/blog/wp-content/pdo/PDOEngine.php(53): PDO_Engine->connect(Array)\n#2 /export/home/jlhuber/httpd/blog/wp-content/pdo/db.php(95): PDO_Engine->PDO_Engine(Array)\n#3 /export/home/jlhuber/httpd/blog/wp-content/pdo/db.php(76): pdo_db->createDBObject()\n#4 /export/home/jlhuber/httpd/blog/wp-content/pdo/db.php(234): pdo_db->pdo_db(‘jlhuber’, ‘nomatter’, ‘/export/home/jl…’, ‘localhost’, ‘sqlite’)\n#5 /export/home/jlhuber/httpd/blog/wp-content/db.php(140): require_once(‘/export/home/jl…’)\n#6 /export/home/jlhuber/httpd/blog/wp-includes/functions.php(2537): require_once(‘/export/home/jl…’)\n#7 /export/home/jlhuber/httpd/blog/wp-settings.php(250): require_wp_db()\n#8 /export/home/jlhuber/httpd/blog/wp-config in /export/home/jlhuber/httpd/blog/wp-content/pdo/PDOEngine.php on line 111

I saw a post that suggested I create the database myself and change the permissions to 777 on the database folder and database. When I do this I get this error:

PHP Fatal error: Call to a member function bail() on a non-object in /export/home/jlhuber/httpd/blog/wp-content/pdo/PDOEngine.php on line 77

Thanks in advance for any help with this.

cyberfishJune 3rd, 2009 at 5:22 am

Thanks for the great plugin!

I just installed it on my blog, and tested it briefly, and everything seems to be working.

However, when I tried to import the content from my old blog (wordpress XML export), I get a

Fatal error: Call to a member function execute() on a non-object in /data/cyberfish/website/blog/wp-content/pdo/PDOEngine.php on line 489

Is there a way to get around that?

Many thanks!

(I can email you the XML dump if that’s needed)

cyberfishJune 3rd, 2009 at 6:11 am

ps. It’s a new installation of WordPress 2.7.1

Plugin version 2.6.0

JustinJune 3rd, 2009 at 7:43 am

Hi Cyberfish
i have never tried an export/import. i would be interested in doing so. So yes – please do send me the xml dump. You can upload to http://www.adieandco.com/uploads
thanks
Justin

JustinJune 3rd, 2009 at 7:49 am

Hello Joshua
The error looks to be caused by permissions. I ought to put the connection code in a try … catch block but typically the permissions issue should be caught in the installation process.
the error that you report is indicative that you are using an older version of the plugin. Try downloading the latest version from wp.org. The current version is 2.6.0.
If you still get a problem then I suggest you do the following
1. delete the wp-content/database folder (or rename it).
2. make sure that the wp-content folder has got 0777 permissions on it and inherited objects (you can change them back later)
3. rerun the installation.
4. change back the perms as you want.

cyberfishJune 3rd, 2009 at 9:56 am

@Justin,

Thanks!

Dump uploaded (wordpress.2009-06-02.xml.zip, unzips to about 1MB)

Joshua HuberJune 3rd, 2009 at 11:48 pm

It works! thanks.

cyberfishJune 12th, 2009 at 3:19 am

@Justin,

any update? =)

fnumaticJune 12th, 2009 at 9:45 pm

Hi Justin,

name mismatch ?

version 2.6.0
pdo_sqlite_driver.php

case “optimize”: $this->rewrite_optimize();

private function rewriteOptimize(){

}

JustinJune 13th, 2009 at 2:51 pm

@fnumatic,
Thanks Ulf. Good spot. Fixed in version 2.6.1 (to be uploaded later today)

JustinJune 13th, 2009 at 2:56 pm

@cyberfish,
sure. i just tried your xml file with a new code version and it imported 11 posts with 671 comments, of which 590 were spam. does that sound right?

i got quite a few errors in the install process, but the same errors appeared in the mysql alternative I ran. They are thrown as warnings so would not normally be visible.

version 2.6.1 will be posted later today.

cyberfishJune 14th, 2009 at 1:05 am

@Justin,

Hmm there should be 24 posts, but I’ll give the new version a try.

Thanks!

cyberfishJune 14th, 2009 at 1:18 am

@Justin,

The new version finishes the import without errors, but only imports 10 posts (I have 24 in the dump). Not sure why.

JustinJune 14th, 2009 at 6:10 am

@cyberfish,
i got a bunch of warnings about implode being given the wrong number of arguments. try turning on error_display and error_reporting to see them.
but these were not PDO errors, the backtrace contained no references to database calls so structurally i assume that these errors come from inconsistencies in the export/import process.
Personally, I’m not sure whether there is a good reason for WordPress to have selected an xml export/import feature when SQL is right there. Probably it is to maintain compatibility with other blogging tools. If you want to go WP->WP, whatever the database flavour, I’d recommend using SQL. You could knock up a migration plugin in a few minutes, I’m sure. Or just use phpmyadmin to grab the SQL dump.

Edward de LeauJune 15th, 2009 at 10:18 am

Im not quite sure but merging (EDIT) comments gives: Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /volume1/web/cogmios/wp-includes/comment.php on line 1093

cyberfishJune 15th, 2009 at 10:21 am

@Justin,

Thanks!

I have made a SQL dump with phpmyadmin. How do I import it into the sqlite database?

JustinJune 15th, 2009 at 10:23 am

@Edward de Leau, that does not sound like a database problem. More likely something wrong with whatever plugin you are using to merge comments.
i have found that WP comes up with a lot of E_NOTICE and E_WARNING messages and it’s best to keep error_reporting turned off unless debugging.

usdesignJune 15th, 2009 at 10:46 am

Hi, Justin. I’m a Japanese. Excuse my poor English.

I’m trying WP 2.7.1 and 2.8 with PDO-SQLite 2.6.0 and 2.6.1 on XAMPP 1.7.0.
I have a problem that the first ‘Hello world!’ cannot be found in the archives.
That is like the problem ‘oursolo’ said.

WP compares MONTH() with varied form values like ’6′, ’06′ or 6.
However http://www.sqlite.org/datatype3.html says:
An INTEGER or REAL value is less than any TEXT or BLOB value,
and http://www.sqlite.org/lang_datefunc.html says that
strftime() substitution %m returns 01-12.
So the type-mismatch or missing the leading zero fails the query.

I have hacked and fixed pdo_sqlite_driver.php ad-hoc like this:

private function rewrite_datetime_functions(){
$pattern = ‘/\b(year|month|day|dayofmonth|unix_timestamp)\s*\((.*?)\)(?:(\s*=\s*)\’(\d+)\’)?/imx’;
$query = preg_replace_callback($pattern, array($this, ‘_rewrite_datetime_functions’), $this->_query);
$this->_query = $query;
}

private function _rewrite_datetime_functions($matches){
switch (strtolower($matches[1])){
case “year”:
$replaced = “CAST(strftime(‘%Y’,{$matches[2]}) AS INTEGER)”;
break;
case “month”:
$replaced = “CAST(strftime(‘%m’,{$matches[2]}) AS INTEGER)”;
break;
case “day”:
case “dayofmonth”:
$replaced = “CAST(strftime(‘%d’,{$matches[2]}) AS INTEGER)”;
break;
case “unix_timestamp”:
$replaced = “CAST(strftime(‘%s’,{$matches[2]}) AS INTEGER)”;
break;
}
if (!empty($matches[3])){
$replaced .= $matches[3] . $matches[4];
}
return $replaced;
}

cyberfishJune 15th, 2009 at 10:47 am

@Justin,

BTW, it appears like (like you have pointed out) it’s not a PDO problem. People are having this problem with MySQL, too.

http://wordpress.org/support/topic/204493

JustinJune 15th, 2009 at 10:49 am

@cyberfish, that’s outside the scope of the plugin. i suggest some software like sqlitemyadmin, sqlitemanager or the like.

or write your own code. essentially all you need to do is mirror what i do in the installation routine (capture the sql, and shove it into the the sql rewriter on a query by query basis.

JustinJune 15th, 2009 at 11:05 am

@usdesign,
i took a design decision not to cast year to integer as i was not sure when two digit years may be made.
otherwise the casting was included in my code at version 2.6.0
i have seen that you have tweaked the regex but i cannot work out what advantage that might give? can you clarify?
to my mind we need to deal with several use cases. as follows:

select 5=’05′ must give true
select 5=5 must give true
select 5=’5′ must give true
select 5=05 must give true

results on non casted values are as follows:
1. false;
2. true;
3. false;
4. true;

but by forcing the cast as per my code:
@usdesign,
i took a design decision not to cast year to integer as i was not sure when two digit years may be made.
otherwise the casting was included in my code at version 2.6.0
i have seen that you have tweaked the regex but i cannot work out what advantage that might give? can you clarify?
to my mind we need to deal with several use cases. as follows:

select cast(5 as int) =’05′ gives true
select cast(5 as int)=5 gives true
select cast(5 as int)=’5′ gives true
select cast(5 as int)=05 gives true

essentially the sqlite parser also performs a cast on the operand.

cyberfishJune 15th, 2009 at 11:10 am

@Justin,

I investigated into this a bit, and it appears like MySQL -> SQLite conversion is a huge pond of mud. I have tried many “conversion scripts”, and non seems to work.

Guess I will have to stick to MySQL, then, until WordPress fixes XML import/export.

Thanks for your great work!

JustinJune 15th, 2009 at 11:13 am

@cyberfish
curious. my plugin does the conversion for you. why are you looking for another conversion script? feel free to upload the sql dump and i will convert it to sqlite when i can.

usdesignJune 15th, 2009 at 11:48 am

My intention is to force integer comparision.
My fixed code works correctly on XAMPP 1.7.0, but original code does not.
I had also cheked with SQLite Database Browser 1.3 on WinXP.
http://sqlitebrowser.sourceforge.net/

Hm… is that dependently SQLite version or platform?

cyberfishJune 15th, 2009 at 12:01 pm

@Justin,

Ah! I never knew the plugin does the conversion. But how?

It doesn’t appear in the plugin page. I tried following the instructions in the readme from my existing installation, and my posts aren’t imported.

I don’t think the readme file mentions this, either.

Thanks

JustinJune 15th, 2009 at 12:28 pm

inconsistent language, i think. my plugin is not a real plugin in that it does not sit in the plugin list. WP has always provided a hook for developers to use alternative database systems though. this is what i am using.

you cannot simply point your sql dump at my code and say go. but the core of my code takes a mysql query and rewrites into in language that sqlite can understand. so you can use the query rewriter to parse the sqldump for you.

alternatively, send through the dump and i will send back a sqlite database.

JustinJune 15th, 2009 at 12:32 pm

i have tested on windows, mac and linux boxes and confirm that the regex that i had together with casting to INT (which is a synonym for integer) correctly fixed the problem.
i cannot judge as to why the code does not work for you. casting and comparisons are such basic functionality that i think it unlikely to be a sqlite library issue.

cyberfishJune 15th, 2009 at 12:51 pm

Ah I see.

Am I right to assume that it’s not exposed to the user?

(sorry I don’t know much about SQL)

SQL dump uploaded.

Many thanks!

usdesignJune 15th, 2009 at 12:54 pm

Thanks Justin, and cyberfish.

I will investigate it a little more and contact you again if I have found the cause.

cyberfishJune 15th, 2009 at 12:59 pm

I wasn’t replying to your comment, but to my own problem :).

usdesignJune 15th, 2009 at 1:31 pm

I am new to WP. The topic that you, cyberfish, pointed out is curious.
That just appear replying me, and it is my misread?
Excuse me… ;-)

BertrandBJune 21st, 2009 at 8:30 pm

Hi a bug i got this message :

Fatal error: print_r() [ref.outcontrol]: Cannot use output buffering in output buffering display handlers in /homepages/35/d168207489/htdocs/bertrand/blog/wp-content/pdo/PDOEngine.php on line 483

with this code

 
BertrandBJune 22nd, 2009 at 8:23 pm

I found the problem is when using thre print_r statement to write information debug2.txt
from :
global $wp_query;
$curauth = $wp_query->get_queried_object();
or :
if(get_query_var(‘author_name’)) :
$curauth = get_userdatabylogin(get_query_var(‘author_name’));
else :
$curauth = get_userdata(get_query_var(‘author’));
endif;

may be an ob_start somewhere else in the api

commenting the line with print_r solve the problem

Edward de LeauJune 24th, 2009 at 12:11 pm

? I upgraded to 2.8 (copied 2.8 files into my synology dir) but not I get a blank screen. when i remove the pdo dir it obv. says i need mysql.

Edward de LeauJune 24th, 2009 at 12:40 pm

but … i commented the last line in wp-db.php again and it works again :)

AnaJune 24th, 2009 at 8:39 pm

Hello,
My server uses PHP 4.4.8. I tried to work with WP 2.6.2 with your plugin but I cannot establish a database connection. I suppose that there is a version mismatch. Which version of your plugin would support PHP4.4.8 and WP2.6.2?
Thank you!

JustinJune 24th, 2009 at 8:44 pm

which line is that?

JustinJune 24th, 2009 at 8:48 pm

Hi Ana
the plugin is primarily designed to enable the use of the PDO abstraction layer. the first ‘driver’ for the PDO abstraction layer that i have written is sqlite.
PDO is not available for versions of php < 5.0. Because of this i took a design decision with the plugin to code in an object oriented style that is not compatible with php 4.x. SFAIK there are very few active installations on php 4.x and those that exist are to maintain existing websites that might break if upgraded. Are you able to upgrade to php 5? you might want to investigate this anyway as php 6 is not far away now. Justin

JustinJune 24th, 2009 at 8:49 pm

curious. thanks for pointing that out.

JustinJune 24th, 2009 at 8:56 pm

ah yes. i see how that could cause a problem. oddly enough it does not seem to trigger a problem on my test machines.
a better solution (because it’s a crime to hack the core) is to change pdo/db.php (lines 35->) to the following

//provide a reference for the native wpdb class
$wpdb = ''; //set the variable so the native db class does not instantiate
require_once ABSPATH.'wp-includes/wp-db.php';

and then at the end of that file change the code to

global $wpdb;
$wpdb = new pdo_db(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST, DB_TYPE);
BaproAugust 11th, 2009 at 11:07 pm

Hello!

After upgrade to WP 2.8.3 i started to see in log:
Warning: implode() [function.implode]: Invalid arguments passed in (…)/wp-includes/post.php on line 1762

I made simple fix in function escape in pdo/db.php to fix this:

function escape($data) {
return is_array($data) ? array_map('addslashes', $data) : addslashes($data);
}

This function was returning only strings before.

I hope that it will be useful for someone.

JustinAugust 12th, 2009 at 8:37 am

@ bapro
thankyou. I have not released the update for 2.8.2 and 2.8.3 yet but this change was spotted and a fix has been integrated in the dev code

oursoloAugust 18th, 2009 at 1:49 pm

hi Justin

report my issue

1.

using 2.6.1 at linux ,got the error log: (seems like it happen when postting large bits content )
[13-Aug-2009 11:35:51] PHP Fatal error: Call to a member function fetchColumn() on a non-object in /**************/wp-content/pdo/PDOEngine.php on line 105
[13-Aug-2009 11:36:43] PHP Fatal error: Maximum execution time of 30 seconds exceeded in /************/wp-content/pdo/PDOEngine.php on line 448

at that moment , the database seems like very slow, hard to open the site’s index page

using 2.6.1 at win2003 , when postting large bits contents ( above 2~30000 bits ), post fail , no response, got a blank page.

——————————————–
2

i click one tag’s link,i found, in the tag list page ( im sure the tag’s number is larger than 30 which click), can’t display the ” page turning” , there should be display ” Older Entries ” at the footer of the page.

i try input the url of page2 in ie , it can be open , but also can’t display the page turn’s link at the footer.

i test the pdo v2.6.1 , 2.5.0 ,even v1.0 , all the same , the link ” Older Entries ” can’t display.

in the same system, the blog use mysql work well.

i hope you can test it , i hope you can help us fix it

oursoloAugust 18th, 2009 at 2:01 pm

additional:

about issue 1, i roll back to pso v2.50 , work well.

and my wordpress version is 2.6.5, php version is 5.*

AnantSeptember 14th, 2009 at 9:56 pm

Hi, I tried installing the plugin version 2.6.1 on wordpress 2.8.4 and I get the following error. Any ideas? Thanks!

Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_terms ( term_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , name text NOT NULL default ”, slug text NOT NULL default ”, term_group integer NOT NULL default 0) ; CREATE UNIQUE INDEX IF NOT EXISTS slug_47 on wp_terms (slug); CREATE INDEX IF NOT EXISTS name_20 on wp_terms (name).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_term_taxonomy ( term_taxonomy_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , term_id integer NOT NULL default 0, taxonomy text NOT NULL default ”, description text NOT NULL, parent integer NOT NULL default 0, count integer NOT NULL default 0) ; CREATE UNIQUE INDEX IF NOT EXISTS term_id_taxonomy_9 on wp_term_taxonomy (term_id,taxonomy); CREATE INDEX IF NOT EXISTS taxonomy_2 on wp_term_taxonomy (taxonomy).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_term_relationships ( object_id integer NOT NULL default 0, term_taxonomy_id integer NOT NULL default 0, term_order integer NOT NULL default 0, PRIMARY KEY (object_id,term_taxonomy_id) ) ; CREATE INDEX IF NOT EXISTS term_taxonomy_id_3 on wp_term_relationships (term_taxonomy_id).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_comments ( comment_ID integer NOT NULL PRIMARY KEY AUTOINCREMENT , comment_post_ID integer NOT NULL default ’0′, comment_author blob NOT NULL, comment_author_email text NOT NULL default ”, comment_author_url text NOT NULL default ”, comment_author_IP text NOT NULL default ”, comment_date text NOT NULL default ’0000-00-00 00:00:00′, comment_date_gmt text NOT NULL default ’0000-00-00 00:00:00′, comment_content text NOT NULL, comment_karma integer NOT NULL default ’0′, comment_approved text NOT NULL default ’1′, comment_agent text NOT NULL default ”, comment_type text NOT NULL default ”, comment_parent integer NOT NULL default ’0′, user_id integer NOT NULL default ’0′) ; CREATE INDEX IF NOT EXISTS comment_approved_35 on wp_comments (comment_approved); CREATE INDEX IF NOT EXISTS comment_post_ID_29 on wp_comments (comment_post_ID); CREATE INDEX IF NOT EXISTS comment_approved_date_gmt_13 on wp_comments (comment_approved,comment_date_gmt); CREATE INDEX IF NOT EXISTS comment_date_gmt_41 on wp_comments (comment_date_gmt).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_links ( link_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , link_url text NOT NULL default ”, link_name text NOT NULL default ”, link_image text NOT NULL default ”, link_target text NOT NULL default ”, link_description text NOT NULL default ”, link_visible text NOT NULL default ‘Y’, link_owner integer NOT NULL default ’1′, link_rating integer NOT NULL default ’0′, link_updated text NOT NULL default ’0000-00-00 00:00:00′, link_rel text NOT NULL default ”, link_notes text NOT NULL, link_rss text NOT NULL default ”) ; CREATE INDEX IF NOT EXISTS link_visible_25 on wp_links (link_visible).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_options ( option_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , blog_id integer NOT NULL default ’0′, option_name text NOT NULL default ”, option_value text NOT NULL, autoload text NOT NULL default ‘yes’) ; CREATE INDEX IF NOT EXISTS option_name_23 on wp_options (option_name).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_postmeta ( meta_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , post_id integer NOT NULL default ’0′, meta_key text default NULL, meta_value text ) ; CREATE INDEX IF NOT EXISTS post_id_24 on wp_postmeta (post_id); CREATE INDEX IF NOT EXISTS meta_key_45 on wp_postmeta (meta_key).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_posts ( ID integer NOT NULL PRIMARY KEY AUTOINCREMENT , post_author integer NOT NULL default ’0′, post_date text NOT NULL default ’0000-00-00 00:00:00′, post_date_gmt text NOT NULL default ’0000-00-00 00:00:00′, post_content text NOT NULL, post_title text NOT NULL, post_excerpt text NOT NULL, post_status text NOT NULL default ‘publish’, comment_status text NOT NULL default ‘open’, ping_status text NOT NULL default ‘open’, post_password text NOT NULL default ”, post_name text NOT NULL default ”, to_ping text NOT NULL, pinged text NOT NULL, post_modified text NOT NULL default ’0000-00-00 00:00:00′, post_modified_gmt text NOT NULL default ’0000-00-00 00:00:00′, post_content_filtered text NOT NULL, post_parent integer NOT NULL default ’0′, guid text NOT NULL default ”, menu_order integer NOT NULL default ’0′, post_type text NOT NULL default ‘post’, post_mime_type text NOT NULL default ”, comment_count integer NOT NULL default ’0′) ; CREATE INDEX IF NOT EXISTS post_name_13 on wp_posts (post_name); CREATE INDEX IF NOT EXISTS type_status_date_33 on wp_posts (post_type,post_status,post_date,ID); CREATE INDEX IF NOT EXISTS post_parent_20 on wp_posts (post_parent).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_users ( ID integer NOT NULL PRIMARY KEY AUTOINCREMENT , user_login text NOT NULL default ”, user_pass text NOT NULL default ”, user_nicename text NOT NULL default ”, user_email text NOT NULL default ”, user_url text NOT NULL default ”, user_registered text NOT NULL default ’0000-00-00 00:00:00′, user_activation_key text NOT NULL default ”, user_status integer NOT NULL default ’0′, display_name text NOT NULL default ”) ; CREATE INDEX IF NOT EXISTS user_login_key_16 on wp_users (user_login); CREATE INDEX IF NOT EXISTS user_nicename_41 on wp_users (user_nicename).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS wp_usermeta ( umeta_id integer NOT NULL PRIMARY KEY AUTOINCREMENT , user_id integer NOT NULL default ’0′, meta_key text default NULL, meta_value text ) ; CREATE INDEX IF NOT EXISTS user_id_15 on wp_usermeta (user_id); CREATE INDEX IF NOT EXISTS meta_key_39 on wp_usermeta (meta_key).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error ) Error installing the database
Query was ; CREATE TABLE IF NOT EXISTS modTimes (modFile text not null primary key, modTime text not null default ’0000-00-00 00:00:00′).
Error message was: Array ( [0] => HY000 [1] => 1 [2] => near “NOT”: syntax error )

ProteusSeptember 26th, 2009 at 12:43 pm

Hi, first of all thanks you for this great plugin. I have only one problem: when I view a specific Category on my Blog at the end of the page there is not visible the list of pages or any other link to Previous page or Next page.

If I manually go to the second page by adding “&paged=2″ to the url of any category the blog shows the right contents and a link to “Newer posts” too but anyway there isn’t a link to “Older post”.

I have tried to disable all other plugins but the problem is always there.
I use version 2.0.0 and I’ve also tried the last version but I have the same problem.

Is there any solution to this problem?

JustinSeptember 26th, 2009 at 1:30 pm

Hi,
my plugin does not affect or interact with urls at all. if you are having issues it is much more likely to be related to your theme or some other plugin. definitely not mine.

Justin

JustinSeptember 26th, 2009 at 1:49 pm

i will try and fix this in a later version but i do not get the same error. for the time being i suggest manually creating the tables using the following queries (just cut and paste into whatever sqlite manager you use)

CREATE TABLE wp_users (
  ID  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
  user_login   text NOT NULL DEFAULT '',
  user_pass   text NOT NULL DEFAULT '',
  user_nicename   text NOT NULL DEFAULT '',
  user_email   text NOT NULL DEFAULT '',
  user_url   text NOT NULL DEFAULT '',
  user_registered   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  user_activation_key   text NOT NULL DEFAULT '',
  user_status   INTEGER NOT NULL DEFAULT '0',
  display_name   text NOT NULL DEFAULT '');
CREATE TABLE wp_usermeta (
  umeta_id  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
  user_id  INTEGER   NOT NULL DEFAULT '0',
  meta_key   text DEFAULT NULL,
  meta_value  text );
CREATE TABLE wp_terms (
 term_id  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
 name   text NOT NULL DEFAULT '',
 slug   text NOT NULL DEFAULT '',
 term_group  INTEGER NOT NULL DEFAULT 0);
CREATE TABLE wp_term_taxonomy (
 term_taxonomy_id  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
 term_id  INTEGER   NOT NULL DEFAULT 0,
 taxonomy   text NOT NULL DEFAULT '',
 description  text NOT NULL,
 parent  INTEGER   NOT NULL DEFAULT 0,
 COUNT  INTEGER NOT NULL DEFAULT 0);
CREATE TABLE wp_term_relationships (
 object_id  INTEGER   NOT NULL DEFAULT 0,
 term_taxonomy_id  INTEGER   NOT NULL DEFAULT 0,
 term_order   INTEGER NOT NULL DEFAULT 0,
 PRIMARY KEY  (object_id,term_taxonomy_id)
);
CREATE TABLE wp_posts (
  ID  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
  post_author  INTEGER   NOT NULL DEFAULT '0',
  post_date   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  post_date_gmt   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  post_content  text NOT NULL,
  post_title  text NOT NULL,
  post_excerpt  text NOT NULL,
  post_status   text NOT NULL DEFAULT 'publish',
  comment_status   text NOT NULL DEFAULT 'open',
  ping_status   text NOT NULL DEFAULT 'open',
  post_password   text NOT NULL DEFAULT '',
  post_name   text NOT NULL DEFAULT '',
  to_ping  text NOT NULL,
  pinged  text NOT NULL,
  post_modified   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  post_modified_gmt   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  post_content_filtered  text NOT NULL,
  post_parent  INTEGER   NOT NULL DEFAULT '0',
  guid   text NOT NULL DEFAULT '',
  menu_order   INTEGER NOT NULL DEFAULT '0',
  post_type   text NOT NULL DEFAULT 'post',
  post_mime_type   text NOT NULL DEFAULT '',
  comment_count  INTEGER NOT NULL DEFAULT '0');
CREATE TABLE wp_postmeta (
  meta_id  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
  post_id  INTEGER   NOT NULL DEFAULT '0',
  meta_key   text DEFAULT NULL,
  meta_value  text );
CREATE TABLE wp_options (
  option_id  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
  blog_id   INTEGER NOT NULL DEFAULT '0',
  option_name   text NOT NULL DEFAULT '',
  option_value  text NOT NULL,
  autoload   text NOT NULL DEFAULT 'yes');
CREATE TABLE wp_links (
  link_id  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
  link_url   text NOT NULL DEFAULT '',
  link_name   text NOT NULL DEFAULT '',
  link_image   text NOT NULL DEFAULT '',
  link_target   text NOT NULL DEFAULT '',
  link_description   text NOT NULL DEFAULT '',
  link_visible   text NOT NULL DEFAULT 'Y',
  link_owner  INTEGER   NOT NULL DEFAULT '1',
  link_rating   INTEGER NOT NULL DEFAULT '0',
  link_updated   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  link_rel   text NOT NULL DEFAULT '',
  link_notes  text NOT NULL,
  link_rss   text NOT NULL DEFAULT '');
CREATE TABLE wp_comments (
  comment_ID  INTEGER   NOT NULL  PRIMARY KEY AUTOINCREMENT ,
  comment_post_ID  INTEGER   NOT NULL DEFAULT '0',
  comment_author   BLOB NOT NULL,
  comment_author_email   text NOT NULL DEFAULT '',
  comment_author_url   text NOT NULL DEFAULT '',
  comment_author_IP   text NOT NULL DEFAULT '',
  comment_date   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  comment_date_gmt   text NOT NULL DEFAULT '0000-00-00 00:00:00',
  comment_content  text NOT NULL,
  comment_karma   INTEGER NOT NULL DEFAULT '0',
  comment_approved   text NOT NULL DEFAULT '1',
  comment_agent   text NOT NULL DEFAULT '',
  comment_type   text NOT NULL DEFAULT '',
  comment_parent  INTEGER   NOT NULL DEFAULT '0',
  user_id  INTEGER   NOT NULL DEFAULT '0');
CREATE TABLE modTimes (modFile  text NOT NULL PRIMARY KEY, modTime  text NOT NULL DEFAULT '0000-00-00 00:00:00');
CREATE INDEX comment_approved_26 ON wp_comments (comment_approved);
CREATE INDEX comment_approved_date_gmt_43 ON wp_comments (comment_approved,comment_date_gmt);
CREATE INDEX comment_date_gmt_27 ON wp_comments (comment_date_gmt);
CREATE INDEX comment_post_ID_39 ON wp_comments (comment_post_ID);
CREATE INDEX link_visible_4 ON wp_links (link_visible);
CREATE INDEX meta_key_0 ON wp_postmeta (meta_key);
CREATE INDEX meta_key_34 ON wp_usermeta (meta_key);
CREATE INDEX name_31 ON wp_terms (name);
CREATE INDEX option_name_36 ON wp_options (option_name);
CREATE INDEX post_id_14 ON wp_postmeta (post_id);
CREATE INDEX post_name_43 ON wp_posts (post_name);
CREATE INDEX post_parent_22 ON wp_posts (post_parent);
CREATE UNIQUE INDEX slug_44 ON wp_terms (slug)
CREATE INDEX taxonomy_7 ON wp_term_taxonomy (taxonomy);
CREATE UNIQUE INDEX term_id_taxonomy_6 ON wp_term_taxonomy (term_id,taxonomy);
CREATE INDEX type_status_date_47 ON wp_posts (post_type,post_status,post_date,ID);
CREATE INDEX user_id_32 ON wp_usermeta (user_id);
CREATE INDEX user_login_key_26 ON wp_users (user_login);
CREATE INDEX user_nicename_22 ON wp_users (user_nicename);
ProteusSeptember 27th, 2009 at 11:10 am

Hi Justin,
I tried installing the plugin version 2.6.1 on wordpress 2.8.4 on another site. I’m using the classic theme without any plugin installed. I have set 2 post per page and added 5 simple post in 2 different category. When I try to view posts in “Curiosity” category WordPress shows the last 2 posts but there isn’t any link to older post to view third post in that category. Is it possible that there is another problem in “pdo_sqlite_driver.php” such as for the Archive where we have to modify the function “private function _rewrite_datetime_functions”?
Thank you for your answer.

JustinSeptember 27th, 2009 at 11:31 am

Proteus

you should not have to adjust the rewrite date time methods. sfaik the current wp.org version (2.6.1) handles this just fine.

as said, the plugin does not interact with the url rewriting functions, nor with any html generating functions. so i assume that some other error is being thrown. i will see whether i can regenerate the behaviour that you see.

please note that i have not tested the plugin with any version of wp past 2.8.0

WordPress на SQLiteSeptember 27th, 2009 at 4:45 pm

[...] изначально на SQLite, без установки на MySQL. Скачать плагин Страница плагина Смотрите также Вышел FireFox 3.5 + обзор FireFox аддонов для [...]

ProteusSeptember 27th, 2009 at 11:03 pm

Hi Justin,

I did some other test with WP on other site, other language and so on but the problem is always the same. I think that the problem is linked to a variable such as “$max_page” or “$wp_query->max_num_pages” which is not right set when is selected a Category so WP don’t know that there are other pages to link to. Infact when I try the “WP Page Numbers” plugin it has the same problem: do not shows pages list on category because when I click on any category the “$max_page” variable is never set while in other cases is always correct. I don’t know where WP set that variable so now I have solved my problem by installing that plugin and adding some code line to it to calculate the right “$max_page” value when view any category.
Thank you again.

synpeyOctober 4th, 2009 at 6:15 pm

Hi,
I’ve been trying to use this great plug-in but not able to instal for a few a hours.

I checked the output of phpinfo() and print_r(PDO::getAvailableDrivers()); and they said..

#phpinfo()
PDO support enabled
PDO drivers sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $
SQLite Library 3.2.8

#print_r(PDO::getAvailableDrivers());
Array ( [0] => sqlite )

and I also checked my php-config.php
define(‘DB_TYPE’, ‘sqlite’);

I believe sqlite3 is fairly utilized and have no idea what to do next.

BTW, I’m using
WP 2.8.4
apache2 with mod-fcgid

thank you.

JustinOctober 4th, 2009 at 8:56 pm

Hi
please bear in mind that PDO for WordPress has not been tested with WP 2.8.4. I know there are compatibility issues but have not had the time to remedy them.

D_mannOctober 27th, 2009 at 12:30 am

Thanks for this plug-in, it makes setting up quick WP sites easy.

I have an odd issue on 2 different sites, both using version 2.6.1 (one site is WP 2.7.1 and the other is WP 2.8.5). If a post is made with the using the following characters “),” w/o the quotes the post becomes un-editable and you get the following error:

Fatal error: Maximum execution time of 30 seconds exceeded in ***\blog\wp-content\pdo\PDOEngine.php on line 448

or

Fatal error: Maximum execution time of 30 seconds exceeded in ***\blog\wp-includes\wp-db.php on line 383

The only way to correct the issue is deleting the post and re-entering it, without the ), in the post.

The workaround at the moment is to use [] instead of (). Please let me know if you have any ideas.

Thanks.

pulsedOctober 28th, 2009 at 8:31 am

Hey Justin am just slightly uncertain but is ur plugin able to provide functionalities to hookup to ms sql?

JustinOctober 28th, 2009 at 8:46 am

Hi
i don’t have any windows boxes nor ms sql to test with the plugin. however a colleague has contributed a driver file which he uses for ms sql + WP. It’s in my ‘to build and test’ pile but if you would like I can send it to you if you promise to give feedback.

mesziNovember 2nd, 2009 at 3:03 pm

I tried to set up a blog with the wp-e-commerce plugin and PDO for WordPress. Used WordPress 2.8.5. But no luck. It appears that both are incompatible. Unfortunately. Will give it a try on some other web that does not have a shop built-in.

mesziNovember 2nd, 2009 at 3:10 pm

Obviously it wasn’t the e-commerce plugin. Having the same issue in some other WordPress blog (v2.8.4). Error message is…

Warning: Cannot modify header information – headers already sent by (output started at /var/www/de/wp-content/db.php:1) in /var/www/de/wp-includes/pluggable.php on line 865

…while /var/www/de/ is the blogs directory.

BuLeNovember 4th, 2009 at 7:23 am

Hi Justin,

I am not an advanced nor php user but i don’t mind learning.
Tried to install wp with sqlite using your plugin did not work, stops at “Invalid or missing PDO Driver

Your PHP installation appears not to have the right PDO drivers loaded. These are required for this version of WordPress and the type of database you have specified.”

I have this spec on my shared hosting:
===========================
PDO
PDO support enabled
PDO drivers sqlite, sqlite2, mysql

pdo_mysql
PDO Driver for MySQL, client library version 4.1.22

pdo_sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version (bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.3 2007/12/31 07:20:10 sebastian Exp $
SQLite Library 3.3.7
===========================
Should that be enough?

I have done chmod-ing 777 to wp-content
Yet to no avail.

In process dwonloading the latest xampp(1.7.2) for my local, will see if it’s working locally.

AndrewNovember 9th, 2009 at 11:29 pm

Hi,
fyi – I’ve just tried a fresh install on a WAMP machine, WP 2.7.1, and the current version of the plugin.

I was getting the “Invalid or missing PDO Driver Your PHP installation appears not to have the right PDO drivers loaded” message, despite having:

pdo extension enabled
pdo sqlite extension enabled
wp-config-sample.php modifed with the required line
PHP 5.2.6

phpinfo() includes:
PDO
PDO support enabled
PDO drivers mssql, mysql, sqlite, sqlite2

pdo_sqlite
PDO Driver for SQLite 3.x enabled
PECL Module version 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6.2.3 2007/12/31 07:20:10 sebastian Exp $
SQLite Library 3.3.7undefined

Still got the same problem.

Any ideas?

Regards,
Andy

JamesNovember 14th, 2009 at 8:49 pm

Justin,
Quick question…Would there be a way to patch your code to make the alter statement do this…

As a quick workaround you can use the SQL language.
For example if you have a table like:

CREATE TABLE table1 (field1 INTEGER, field2 INTEGER, field3 INTEGER)
and if you want to change field2 to TEXT and remove field3, you can write the following SQL commands:

CREATE TABLE table1_temp (field1 INTEGER, field2 TEXT);INSERT INTO table1_temp (field1, field2) SELECT DISTINCT field1, field2 FROM table1;DROP TABLE table1;ALTER TABLE table1_temp RENAME TO table1;
With these 4 commands you can CHANGE (manually) every table definitions.
Please note that in this way you need to re-create indexes, views and triggers associated to table1.

JustinNovember 14th, 2009 at 9:29 pm

yes. something like that is possible. but the way that dbdelta works is a bit ugly and if we were to use that method a table swap would be done for every aspect of the schema change (per column).

i’m sure there is a better method but i am also concerned that WP is moving more and more into bespoke mysql functions (minimum version is now 4.2, for subquery support i believe), and the more esoteric the mysql usage becomes, the more of a pain in the ass it is to support the transformations to sqlite.

MateaDecember 8th, 2009 at 6:10 pm

Hi, Justin.. Thanks for this plugin!
Signup for sql azure free beta to test mssql driver for mssql+wp.
It would be nice to move wp db in cloud and seeing sql azure price, will be shame not doing that.

subviiDecember 20th, 2009 at 1:21 pm

I was seeing the “Warning: implode() [function.implode]: Invalid arguments passed in” error as in a comment above.
Debugged and fixed it in a similar way (unfortunately before coming here, would have saved some time).
Tried to raise a bug but pdo component doesn’t seem to be listed.

JustinJanuary 14th, 2010 at 1:41 pm

a new version of PDO for WordPress is now uploaded to WP.org. it is now compatible with WP 2.9.1

JustinJanuary 14th, 2010 at 1:43 pm

@James:
yes – something like that is possible but it’s a righteous headache to get right for all circumstances. and the way that dbdelta() works is that alter commands are issued column by column. so if you used it to alter, say, 5 columns on a big table, the operation would take a huge amount of time.

if anyone fancies sending a patch file to handle alter queries from dbdelta, then i’d love to take a look.

Justin

alexJanuary 30th, 2010 at 9:21 am

Hi, Justin

I see the “Warning: implode() [function.implode]: Invalid arguments passed in /***/wp-includes/post.php on line 1980″ error every time I edit a page.

Shoud I use the fix in Bapro’s comment above. Is that fix reliable?

alexJanuary 30th, 2010 at 9:24 am

PS: I’m using WP 2.9.1-zh_CN version.

JustinJanuary 30th, 2010 at 9:29 am

Hi Alex

that should work if the problem is there. for some reason I missed a whole load of functional changes when i updated to 2.7.0. i think i must have uploaded an old file.

i am also working on a fix to the troubling problem of brackets in query values. i have a fix in mind but need to find time to implement it.

Justin

alexJanuary 30th, 2010 at 10:01 am

PSS:pdo-for-wordpress.2.7.0.zip

The error only appears while editing PAGE (/wp-admin/page.php?action=edit&post=###)

I also got a “Cannot set time limit in safe mode” error in PDOEngine.php Line 63
So, I just commented that line. Is that ok?

JustinJanuary 30th, 2010 at 10:27 am

thanks. That will help diagnose. My solution is a bit different to Bapro’s but achieves the same end. I will probably publish an update this week to cover this and some other stupid bugs that I missed.

You’re getting all the good stuff with that ‘Cannot set time limit’ thing. I have not come across safe mode issues before and it never occurred to me to code for people using safe mode. In fact, i have never come across people using safe mode on a production site. However in that particular place set_time_limit() should not be needed. I think I was testing on a server that was under very heavy file-system load at the time. if your script times out here, there’s another problem…

alexJanuary 30th, 2010 at 2:07 pm

The safe mode was set by my virtual host provider and seems can not be turned off by .htaccess…

Thank you very much for the plugin and answering my questions!

Leave a comment

Your comment