By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,959 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,959 IT Pros & Developers. It's quick & easy.

PDO support (bit of a rant)

P: n/a
Hi there,

I've build this little CMS in PHP for a client. It depends on PDO with mysql
driver.

Now, a few webhosts I've polled have PDO support, but only sqlite and
sqlite2 drivers are installed by default. Installing PDO mysql drivers has
proven quite a hastle, and the main webhost I was depending on reported that
quite a few install options made it's configuration crash.

Can anybody tell, how come a PDO mysql driver is not installed by default on
*nix PHP environments?! I would assume this is one of the most asked for PDO
drivers. But more importantly, has anybody managed to succeed in installing
this driver on *nix based systems and have it run stable?

From what I've read on different sites in the PHP community is that PDO is
supposed to be *the* next database abstraction layer for PHP. And although I
have limited experience, I must say, for the not too complex SQL queries it
does its job quite nice, with prepared statements and all. But yet support
for it seems to be rather poor. Especially clear documentation on how to
install specific drivers. What is up with that? How can an extension that
seems to be plugged by quite a few PHP community sites be this poorly
supported?

I am no doubt ranting in the wrong direction, so if you have any pointers as
to where I can rant more effectively, please share. ;-)

Thanks


May 30 '07 #1
Share this Question
Share on Google+
6 Replies


P: n/a
..oO(amygdala)
>I've build this little CMS in PHP for a client. It depends on PDO with mysql
driver.

Now, a few webhosts I've polled have PDO support, but only sqlite and
sqlite2 drivers are installed by default. Installing PDO mysql drivers has
proven quite a hastle, and the main webhost I was depending on reported that
quite a few install options made it's configuration crash.
A while ago I had a similar situation with my host. PDO was there, but
the MySQL driver was missing. They told me I could log into my account
and compile the driver myself, but it didn't work because of some
missing library files. After some more complaints about that they
finally installed the driver on all of their servers ...
>Can anybody tell, how come a PDO mysql driver is not installed by default on
*nix PHP environments?! I would assume this is one of the most asked for PDO
drivers. But more importantly, has anybody managed to succeed in installing
this driver on *nix based systems and have it run stable?
Yep, it works here without any problem on a Debian box. I always compile
my PHP from the sources. All it requires to compile the driver are some
header files for the MySQL client library, which are easily installed
using Debian's packet manager. Never had a problem with that, so
actually I don't know why some hosts refuse to install it.

Micha
May 30 '07 #2

P: n/a
amygdala wrote:
But yet support for it seems to be rather poor. Especially clear
documentation on how to install specific drivers. What is up with that?
PDO's documentation is truly dreadful -- not just how to install drivers,
but the whole thing -- the constants, the exceptions thrown, everything.

It's a really good interface for database programming though. I ported my
CMS from PostgreSQL to MySQL in about 20 minutes. It would have taken me
hours if I'd been using the traditional PHP functions -- and the solution
wouldn't have been as elegant. (The non-PHP script to create the database
tables and populate them with initial data took quite a bit longer to
populate. See http://tobyinkster.co.uk/tag/mysql/.)

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 96 days, 5:11.]

Non-Intuitive Surnames
http://tobyinkster.co.uk/blog/2007/0...tive-surnames/
May 30 '07 #3

P: n/a

"Michael Fesser" <ne*****@gmx.deschreef in bericht
news:9i********************************@4ax.com...
.oO(amygdala)
>>I've build this little CMS in PHP for a client. It depends on PDO with
mysql
driver.

Now, a few webhosts I've polled have PDO support, but only sqlite and
sqlite2 drivers are installed by default. Installing PDO mysql drivers has
proven quite a hastle, and the main webhost I was depending on reported
that
quite a few install options made it's configuration crash.

A while ago I had a similar situation with my host. PDO was there, but
the MySQL driver was missing. They told me I could log into my account
and compile the driver myself, but it didn't work because of some
missing library files. After some more complaints about that they
finally installed the driver on all of their servers ...
Yeah, the thing is, I'm a Windows guy (yeah, boooh! ;-). And frankly I don't
wanna be bothered too much with *nix stuff or any other too obscure (for me
at least) system configuring stuff for that matter. I think *nix
environments are great, and if you have the knowledge of *nix the more
praise to you. But I'ld like to consider myself foremost to be a
webdeveloper rather than a system administrator. And of course I understand
that you have to have some degree of knowlegde about an OS when you're
developing web applications that depend on security and such. But I mean,
compiling my own drivers is just not my thing. (Hey, I admit, I'm selective
in my interests ;-) So I found myself trying to find a solution for said
hosting company in newsgroups and the likes (with poor knowlegde of *nix),
when all of a sudden I started thinking: What the hell am I doing? I'm
trying to offer this hosting company solutions, while I just can't imagine
PDO mysql not being supported by default. Or at least easily switched on or
off easily. Hence this kind of rant. :-/
>>Can anybody tell, how come a PDO mysql driver is not installed by default
on
*nix PHP environments?! I would assume this is one of the most asked for
PDO
drivers. But more importantly, has anybody managed to succeed in
installing
this driver on *nix based systems and have it run stable?

Yep, it works here without any problem on a Debian box. I always compile
my PHP from the sources. All it requires to compile the driver are some
header files for the MySQL client library, which are easily installed
using Debian's packet manager. Never had a problem with that, so
actually I don't know why some hosts refuse to install it.
Well there you go! Like I said, I know very little of *nix, but I just
couldn't imagine that one couldn't make a clean PDO mysql install.
I have some mental image of what compiling from the sources would embody and
I also found some other 'solutions' like the configure line --with-pdo-mysql
and a bunch of other install options. But then said hosting company didn't
wanna be bothered with it, because they can't seem to make a clean install.
:-/ Luckily I just found a hosting company that *does* have the PDO mysql
driver installed. That saves me a few hours of rewriting code.

Anyway, enough of the ranting and b*tching. I just had to get it out of my
system. And thanks for the input.
Micha

May 31 '07 #4

P: n/a

"Toby A Inkster" <us**********@tobyinkster.co.ukschreef in bericht
news:hl************@ophelia.g5n.co.uk...
amygdala wrote:
>But yet support for it seems to be rather poor. Especially clear
documentation on how to install specific drivers. What is up with that?

PDO's documentation is truly dreadful -- not just how to install drivers,
but the whole thing -- the constants, the exceptions thrown, everything.
Yeah, isn't it?!
It's a really good interface for database programming though. I ported my
CMS from PostgreSQL to MySQL in about 20 minutes. It would have taken me
hours if I'd been using the traditional PHP functions -- and the solution
wouldn't have been as elegant. (The non-PHP script to create the database
tables and populate them with initial data took quite a bit longer to
populate. See http://tobyinkster.co.uk/tag/mysql/.)
My thoughts exactly, that's what was so frustrating about it. I really see a
lot of potential for PDO. It could still use a little tweaking, such as
support for preparing queries with LIMIT clause parameter support, to name
one. But for the projects I'm envolved in (not too demanding) it suites me
very good. Also the elegancy part and ease of porting you're talking about I
agree with. I really hope the PHP developer community will pick up on
elaborating about PDO and giving it the attention it IMHO deserves.

Cheers.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 96 days, 5:11.]

Non-Intuitive Surnames
http://tobyinkster.co.uk/blog/2007/0...tive-surnames/

May 31 '07 #5

P: n/a

"Toby A Inkster" <us**********@tobyinkster.co.ukschreef in bericht
news:hl************@ophelia.g5n.co.uk...
amygdala wrote:
>But yet support for it seems to be rather poor. Especially clear
documentation on how to install specific drivers. What is up with that?

PDO's documentation is truly dreadful -- not just how to install drivers,
but the whole thing -- the constants, the exceptions thrown, everything.

It's a really good interface for database programming though. I ported my
CMS from PostgreSQL to MySQL in about 20 minutes. It would have taken me
hours if I'd been using the traditional PHP functions -- and the solution
wouldn't have been as elegant. (The non-PHP script to create the database
tables and populate them with initial data took quite a bit longer to
populate. See http://tobyinkster.co.uk/tag/mysql/.)
I encountered an error on your site:

http://tobyinkster.co.uk/article/about-status/
BTW, recently I've used one of the things you have suggested at one point in
time in (I think it was this newsgroup) about mod_rewrite:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1
$_GET['nav'] = explode('/',$_SERVER['PATH_INFO']);

Great input. Just what I needed recently.

Cheers
May 31 '07 #6

P: n/a
amygdala wrote:
I encountered an error on your site:
http://tobyinkster.co.uk/article/about-status/
Yeah -- I've not written that page yet. I really must.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 96 days, 16:11.]

Non-Intuitive Surnames
http://tobyinkster.co.uk/blog/2007/0...tive-surnames/
May 31 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.