phpinfo()
display "Active Persistent Links of 0/1" when I know there are more open connections to my database?On UNIX, Apache and PHP is a single-threaded process. The main web server creates children to deal with HTTP requests. When you set allow_persistent
to On
in your php.ini
file and use odbc_pconnect
, a persistent connection will be created in one of the HTTP child processes. However, it is up to the main HTTP daemon which child will handle the request, and the persistent connection only exists in that HTTP child. You cannot control which HTTP child process will answer the request, so it may be one that has never connected to the database (Active Persistent Links = 0
) or one that has connected to the database (Active Persistent Links = 1
). To confirm this:
allow_persistent = On
is present in your php.ini
file.phpinfo()
. The function output should contain Active persistent Links = 0
. No matter how many times you refresh this page, the Active persistent Links
value should be 0
.odbc_pconnect()
.The only way to get the Active Persistent Links
total to be greater than 1 is to open more than one persistent connection in a single PHP script.