Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A PHP SAPI module to emulate PHP requests in a loop, this can be used to test persistent connections or PHP extensions in threaded environments
branch: master
Failed to load latest commit information.
samples add a sample README
.gitignore Add vim's .swp files to ignore
LICENSE It's 2015! Yay! \o/
Makefile.frag Fix for 5.4 buildsystem changes
README Rename binary to php-pconn instead of pconn
config.m4 Add initial phpt support
config.w32 Windows compatibility.
main.c It's 2015! Yay! \o/
pconnect-module.c It's 2015! Yay! \o/
pconnect-module.h It's 2015! Yay! \o/
pconnect-phptparser.c It's 2015! Yay! \o/
pconnect-phptparser.h It's 2015! Yay! \o/
pconnect-sapi.c It's 2015! Yay! \o/
pconnect.h It's 2015! Yay! \o/
template.rc It's 2015! Yay! \o/


pconnect tester for PHP

This is a small tool helping while testing persistent connections with PHP,
without the need for installing and configuring a web server and the
complexity added by such a web server.

This tool simulates  multiple requests by running a PHP script multiple times
simulating multiple requests. The executed script can then open persistent
connections and verify the connection on following requests.

This simplifies automation of tests and memory checking.


For installation put this code into a directory sapi/pconn inside a PHP
source tree, then run `./buildconf` and `./configure` PHP using the
--enable-pconn switch. For testing multithreading make use of
the --enable-maintainer-zts switch.

When running `make` a binary `sapi/pconn/php-pconn` is created. Currently this
won't be installed by `make install`.

This package includes a simple sample:
$ ./php-pconn -a samples/start.php -z samples/shutdown.php -n10 samples/main.php 

If your PHP was compiled with --enable-maintainer-zts you can run multiple
$ ./php-pconn -a samples/start.php -z samples/shutdown.php -n10 -t5 samples/main.php 

This will first call start.php then 10x main.php and shutdown.php in the second
case this will be done in 5 threads in parallel. This sample also demonstrates
transport of data with $_PCONN which is a thread-specific container for data
which is available in all requests, similar to $_SESSION. As user you can put 
anything serializable in there.

Something went wrong with that request. Please try again.