Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 1.43 KB

README.md

File metadata and controls

45 lines (34 loc) · 1.43 KB

cowboy_fastcgi

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.

Setting it up

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.

Build

make

Run it

make shell

Test it

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.

Related reads

License

The source code is released under Apache 2 License.

Check LICENSE file for more information.