14.3 PHP and Perl

On Mac OS X Panther, MySQL support is built in to PHP. If you want PostgreSQL support, you must reinstall PHP from source.

You can install general database support in Perl by installing the DBI module with the cpan utility (see Chapter 10). After that, you can install the DBD::mysql module for MySQL-specific support, and DBD::Pg for PostgreSQL-specific support. Because there are some steps to these installations that the cpan utility can't handle, you should download the latest builds of these modules from http://www.cpan.org/modules/by-module/DBD/ and install them manually. Be sure to check the README files, since some aspects of the configuration may have changed.

The DBD:mysql module requires a database in which to perform its tests. You can use the database and username/password that you set up earlier in Configuring MySQL . To install DBD::mysql, you must first generate the Makefile , compile the code, test it, and then install the module if the test run is successful. For example:

 $  perl Makefile.PL --testdb=   dbname   --testuser=   username   \  >  --testpassword=   password  $  make  $  make test  $  sudo make install  

At the time of this writing, DBD::mysql failed to compile on Panther. The short description of the fix is to replace all occurrences of MACOSX with env MACOSX in the Makefile (after generating it with perl Makefile.PL ).

For a complete description, see the Forwarding Address: OS X weblog entry at http://www.saladwithsteve.com/osx/2003_11_01_archive.html#106802251200041735.

As with DBD::mysql, the DBD::Pg module needs a directory to perform its tests. If you'd like, you can use the database, username, and password that you set up earlier when configuring PostgreSQL.

You must first generate the Makefile , compile the code, set up environment variables that specify the database, username, and password, and then run the tests. If the tests run successfully, you can install DBD::Pg:

 $  perl Makefile.PL  $  make  $  export DBI_DSN=dbi:Pg:dbname=   username  $  export DBI_USER=   username  $  export DBI_PASS=   password  $  make test  $  sudo make install  

Mac OS X Panther for Unix Geeks
Mac OS X Panther for Unix Geeks
ISBN: 0596006071
EAN: 2147483647
Year: 2003
Pages: 212

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net