Categories
Archives
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- April 2007
- March 2007
- February 2007
- January 2007
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
An Easy Way to Implement Namespaces in JavaScript | Home | Deposit-friendly Development
Filed under Quick Tips on June 9, 2008 by Ben SgroGetting started with PDO_MSSQL
The Zend framework requires that if you want your application to work on both Windows and Linux, and take advantage of Zend's ORM (DB_Table_Abstract) functionality, you have to install and use the PDO_MSSQL driver.You can first try to install via PECL (however this didn't work in our case):
bens@arc90-dev-02:~/PDO_DBLIB-1.0$ sudo pecl install PDO_DBLIB
pear/PDO_DBLIB requires PHP extension "pdo" (version >= 1.0)
No valid packages found
install failed
bens@arc90-dev-02:~/PDO_DBLIB-1.0$ sudo pecl install PDO
Skipping package "pecl/PDO", already installed as version 1.0.3
No valid packages found
install failed
Instead, download the source and use phpize (which prepares the extension compiling) in the root directory of PDO:
bens@arc90-dev-02:~/PDO_DBLIB-1.0$ phpize
Configuring for:
PHP Api Version:Â Â Â Â Â Â Â Â 20041225
Zend Module Api No:Â Â Â Â Â 20060613
Zend Extension Api No:Â Â 220060519
Then execute the configure script to build the pdo module.
bens@arc90-dev-02:~/PDO_DBLIB-1.0$ sudo ./configureÂ
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
...[removed for brevity]....
----------------------------------------------------------------------
Libraries have been installed in:
  /home/bens/PDO_DBLIB-1.0/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
  - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
    during execution
  - add LIBDIR to the `LD_RUN_PATH' environment variable
    during linking
  - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
  - have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
If all went successful, you should see a similar message. Now, copy the module (pdo_dblib.so) from the build directory to your php directory:
bens@arc90-dev-02:~/PDO_DBLIB-1.0/modules$ sudo cp pdo_dblib.so /usr/lib/php5/20060613+lfs/
Then, copy the pdf_dblib.so to /usr/lib/php5/20060613+lfs/
Make a backup of your php.ini file and add the following to the php.ini file:
extension=pdo_dblib.so
Restart apache add the following to your config.ini in the Zend project you would like to use the PDO driver (on Linux):
database.adapter         = "pdo_mssql"
database.pdoType       = "dblib"
PDO should be setup and working. Enjoy.
Trackback Pings (TrackBack URL for this entry)
http://www.arc90.com/cgi-bin/mt4/mt-tb.cgi/162.
Comments
How is the combo PHP on *nix plus SQL Server 2005 working out for you?
Posted on August 6, 2008 2:29 AM by Lukas
It works well - most of our applications get deployed to Windows - the WAMP stack has some limitations and we've had to jump over some hurdles to get things working properly.
Posted on August 6, 2008 9:25 AM by Ben Sgro
hi thanks for your blog post it really helped me, i just have one question what do you mean by:
[quote]
Restart apache add the following to your config.ini in the Zend project you would like to use the PDO driver (on Linux):
database.adapter         = "pdo_mssql"
database.pdoType       = "dblib"
[/quote]
Posted on October 24, 2008 7:44 PM by Mario
An Easy Way to Implement Namespaces in JavaScript | Main | Deposit-friendly Development

I was planning on using PDO for my current project (and even wrote some code with it) until I found out that seeking to an arbitrary point in a result set wasn't possible. That is one feature that I like to have.
Posted on June 15, 2008 8:32 PM by Peter Goodman