This is a sample application that shows how to call PHP scripts from Erlang.
It uses cowboy as the web server, and erl_fastcgi to call php-fpm and execute PHP scripts and return the result to the browser.
Poolboy is used to create a pool of erl_fastcgi workers to serve the requests.
Clone the repo and edit the file config/sys.config. You will need:
- php-fpm up and running (you can read how in the php manual
- A directory where to put your PHP files.
make
make shell
Create a file like this one in your php_fpm_root directory:
<?php
phpinfo();
Head to http://localhost:8080/php-fpm/test.php and you should see the output of the script.
The source code is released under Apache 2 License.
Check LICENSE file for more information.