473,405 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

PDO support (bit of a rant)

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
6 1833
..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
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

"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

"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

"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: deko | last post by:
How do I get the items selected from a datasheet? Does a datasheet support multiple selections? I know a ListBox has a "Selected" property that can be used when the MultiSelect property is set...
43
by: Zeng | last post by:
It's so messy w/o the "friend" relationship. Does anyone know why it was not supported in C#. It's almost about as bad as it doesn't support the inheritance hierarchy and method reference...
2
by: Jaster | last post by:
Hi. i got some trouble including Managed C++. Refering to: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmxspec/html/vcmg_overview.asp. There is no "Compile As Managed"...
10
by: Bob | last post by:
Hi there, Can anyone point me to anything relating to using XP's built-in CD writing support from VB.Net... or even C#, or classic VB...? I just want to write files to the CD and finalise the...
3
by: Robin Tucker | last post by:
It seems that all of the interfaces, such as IDataObject etc. from basic OLE are no longer supported in .NET, although they are implemented (differently). I have an OLE object type and am having...
12
by: Rafał Maj Raf256 | last post by:
Hi, I have an UNICODE text file endcoded in UTF-8. I should store the UNICODE strings in my program for example in std::wstring right? To be able to work on them normally, so that std::wstring...
8
by: Jamie | last post by:
Hello Newsgroup: This is my little rant about security and why we have home directories. You may choose to ignore it or disagree with it, that is your perogative and I won't care, but... this...
19
by: Eric S. Johansson | last post by:
Almar Klein wrote: there's nothing like self interest to drive one's initiative. :-) 14 years with speech recognition and counting. I'm so looking to my 15th anniversary of being injured next...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.