Skip to content

Example calling PHP from a Cowboy application via FastCGI using php-fpm

License

Notifications You must be signed in to change notification settings

marcelog/cowboy_fastcgi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Example calling PHP from a Cowboy application via FastCGI using php-fpm

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published