Page 1 of 2
Installing PDO drivers on Fedora Core 5
Posted: Thu Oct 12, 2006 1:48 pm
by RobertGonzalez
So I am in the middle of a nasty wrestling match with connecting to Sybase. I have no Sybase drivers or client API's on the server we are trying to roll out. Apparently Open Client is not free. I don't want to install the entire database server on this test machine because we already have a test database set up on another machine, but I can't connect to it using the sybase functions (I installed the sybase extensions, but I think they are choking because there are not client API's on the server).
So I tried PDO. But PDO cannot find the PDO_DBLIB drivers. A print_r of PDO::getAvailableDrivers() shows this:
Code: Select all
Array
(
[0] => mysql
[1] => sqlite
)
So how do I add the freaking drivers I need to PDO so I can connect to this freaking database? Can anyone help me. Google is not my friend today.
Posted: Thu Oct 12, 2006 2:06 pm
by volka
Did you search the fedora extra repositories?
http://fedoraproject.org/wiki/Extras
Posted: Thu Oct 12, 2006 3:23 pm
by RobertGonzalez
Yeah, I have freaking searched everywhere. The sad is the packages I need are installed on another system, but the RPMs aren't there. The RPM's are apparently not available for free anymore (I think, though I could be wrong), so I am in a bit of a pickle.
Posted: Thu Oct 12, 2006 3:33 pm
by Jenk
http://pecl.php.net/package/PDO_DBLIB
download and 'install' (i.e. decompress into your ext dir and add to php.ini) manually.
Posted: Thu Oct 12, 2006 3:45 pm
by RobertGonzalez
Dude you freaking rock. Ok, now how do I build it?
EDIT | After looking through the readme, it looks like this is a windows binary app. Here are the files that came out of the tarball:
Code: Select all
# ls
config.m4 CREDITS dblib_driver.c dblib_stmt.c pdo_dblib.c php_pdo_dblib.h php_pdo_dblib_int.h README
Here is the README file
Code: Select all
# cat README
This is the unified Sybase-DB style driver for PDO.
There are three implementations of this library that are known to me:
- The Sybase DB lib itself
- MSSQL DB lib
- FreeTDS DB lib
[b]This extension will compile and register itself as 'mssql' when built against
the mssql libraries (and be named php_pdo_mssql.dll), or 'sybase' otherwise
(php_pdo_sybase.dll)
[/b]
If you want to try out the free "desktop" version of SQL Server, known as the MSDE, google to obtain the appropriate download link. Here are some short tips on getting it running:
- Download it and run it to extract it
- Open up a command prompt
- cd \MSDERelA
- setup.exe SQLSECURITY=1 SAPWD=yoursecretpassword
- cd \Program Files\Microsoft SQL Server\80\Tools\Binn
- SVRNETCN.exe
- enable TCP (you MUST do this if you want to access it via FreeTDS/Sybase libs)
- net start mssqlserver
Consult the MS docs for more information about all this stuff.
What do you think, is this a dll maker?
Posted: Thu Oct 12, 2006 4:44 pm
by neophyte
If I were you I'd build and configure my own PHP5. In times past I relied on the distro I was using to provide PHP binaries. But I always end up bumping into something thats not quite the way I want it. So I started building my own stuff. It was a PITA to learn but I can now build whatever whenever and I don't have to wait for a distro upgrade.
I was using FC5 a while back and it didn't have SQLite built in. So I had to go digging around for an RPM to install it with.

I ended up finding it on an Fedora board.
My 2cents...
Posted: Thu Oct 12, 2006 4:49 pm
by RobertGonzalez
I am looking for sybase-common and the sybase-openclient rpms. I can't find them anywhere for Sybase ASE 12.5. I loaded the PDO extension, but it only comes with the MySQL and SQLite drivers, hence my need for PDO_DBLIB drivers. I am in such an awful mood right now because I feel like a complete idiot not being able to get connected to Sybase on this machine. I am so irritated.

Posted: Fri Oct 13, 2006 4:03 am
by Jenk
You can use pear to install the libs; I've just noticed:
Code: Select all
pear download pdo_dblib
pear install pdo_dblib
Posted: Fri Oct 13, 2006 10:14 am
by RobertGonzalez
I downloaded the source for PDO_DBLIB from PECL and tried to build it, but ./configure is choking on the path to freetds. Eventhough freetds is in the path specified by the configure loop, it still won't find it. Not sure why.
I'll look into pear and see if that will be easier. Thanks for the pointers. I do appreciate them.
Posted: Fri Oct 13, 2006 10:18 am
by Jenk
you can also use phpize too.. but that's not as widely available afaik:
Code: Select all
cd /path/to/directory/containing/source/files
phpize
./configure
make && make install
Posted: Fri Oct 13, 2006 10:21 am
by RobertGonzalez
It is with the php-devel package. I downloaded/installed that yesterday to turn that source code into something buildable. It is a sweet little app.
Posted: Fri Oct 13, 2006 10:30 am
by RobertGonzalez
Jenk wrote:You can use pear to install the libs; I've just noticed:
Code: Select all
pear download pdo_dblib
pear install pdo_dblib
Do you have to do this from a particular directory?
Posted: Fri Oct 13, 2006 10:36 am
by Jenk
Posted: Fri Oct 13, 2006 10:40 am
by RobertGonzalez
Tried downloading, got this...
Code: Select all
# pear download pdo_dblib
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/sybase_ct.so' - /usr/lib/php/modules/sybase_ct.so: undefined symbol: empty_string in Unknown on line 0
No releases available for package "pear.php.net/pdo_dblib" - package pecl/pdo_dblib can be installed with "pecl install pdo_dblib"
Cannot initialize 'pdo_dblib', invalid or missing package file
Package "pdo_dblib" is not valid
download failed
Then I figured I try to install instead of downloading...
Code: Select all
# pear install pdo_dblib
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/sybase_ct.so' - /usr/lib/php/modules/sybase_ct.so: undefined symbol: empty_string in Unknown on line 0
No releases available for package "pear.php.net/pdo_dblib" - package pecl/pdo_dblib can be installed with "pecl install pdo_dblib"
Cannot initialize 'pdo_dblib', invalid or missing package file
Package "pdo_dblib" is not valid
install failed
Then I tried pecl...
Code: Select all
# pecl install pdo_dblib
pear/PDO_DBLIB requires PHP extension "pdo" (version >= 1.0)
No valid packages found
install failed
Am I just cursed?

Posted: Fri Oct 13, 2006 11:24 am
by Jenk
hmm..
Have you got pdo installed?
if not run "pecl install pdo" (or pear) then try again with pdo_dblib