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:
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.
# 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.
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.
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.
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.
# 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...
# 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