views:

82

answers:

2

I wonder, how am I supposed to know which libraries I should include in my php.ini file when using a certain function.

For instance, I just looked up pg_connect(), and I wonder which libraries I should include.

I can think of php_pgsql.dll, but that's about it. Do I need others? I wouldn't know, since that doesn't seem to be documented anywhere.

In general, my main problem is that I can't locate this when looking at the PHP online manual. Or am I suffering from poor eyesight?

So, if I come across a function, where can I find out which library it depends on?

+3  A: 

For functions like pg_connect(), it's generally in the installation notes a little bit up the doc tree. In this case, here.

From the pg_connect() page, you'd find your way there by clicking on PostgreSQL in the left nav, then Installation under Installing/Configuring in the overview on the right. Most PHP web manual sections follow a similar model.

chaos
A: 

One good bet is just to go through the list in PHP.INI once or twice and learn what the libraries do. One function will generally be in one library. There aren't really many inter-library dependencies.

The best bet, however, is to just turn them all on unless they are clearly and obviously something you won't ever use, such as most of the vendor-specific database extensions. That way, you'll never have to worry about twiddling your PHP.INI. Except on a very heavily-trafficked site, the difference is imperceptible. And if you do have high traffic, you might be better off with one of those accelerator tools that pre-parses your code, keeps the binaries loaded, and so forth. (e.g. Zend accelerator.)

Ian