Home > bigbluebutton, nginx, php > Enable PHP on BigBlueButton .71 Server

Enable PHP on BigBlueButton .71 Server

It’s been asked a couple times how to run PHP on a BigBlueButton (BBB) server. The following has been tested on the .71 BBB virtual image.

BBB uses nginx to route incoming web traffic red5, tomcat and some other stuff. Because of that, you can’t use any urls that start with /bigbluebutton, /deskshare, /client, /open/, /close, /idle/, /send/. But we can install php and enable it for other urls.

First we need to install php5-fpm. It’s not included in the ubuntu 10.04 php packages, so we’ll use a PPA for it.

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:brianmercer/php
sudo apt-get update
sudo apt-get install php5-fpm

Open /etc/php5/fpm/php5-fpm.conf with your favorite editor and find the line that starts with listen, and edit to this:

listen = /var/run/php5-fpm.socket

Now we need to tweak the nginx site config file vim /etc/nginx/sites-enabled/bigbluebutton. At the end – but before the last } – we need to add the following block of code:

 location ~ .php$ {
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_pass   unix:/var/run/php5-fpm.socket;
    fastcgi_param  SCRIPT_FILENAME  /var/www/bigbluebutton-default$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;

This is optional, but if you may want to find the block that starts with location / { and add index.php to the list of indexes. This will allow you to use index.php if you use a url to a directory with no explicit filename.

Now restart php5-fpm:

sudo /etc/init.d/php5-fpm restart

And restart nginx:

sudo /etc/init.d/nginx restart

Let’s test it out. Create a file /var/www/bigbluebutton-default/test.php with this:

<?php phpinfo(); ?>

Then test it by going to http://<ip>/test.php.

Now you can install any other php packages you may need for whatever you want to do – like php5-mysql…

You’ll need to run /etc/init.d/php5-fpm restart after installing php packages.

  1. 2011/10/28 at 1:44 am

    All professionalism aside, I just want to say, “I love you.”. This is JUST what I needed. Well done. =)

  2. 2012/04/11 at 3:44 pm

    i have installed the apache2 and changed nginx’s ip address and now both are working, but when i clicking on join (a meeting) in (running with apache2) i seeing this error:

    Unable to join the meeting. Please check the url of the bigbluebutton server AND check to see if the bigbluebutton server is running.

    please help me 😦

  3. Jashelle
    2012/06/15 at 3:44 pm

    This is exactly what I needed! I needed to know which directory to use without actually breaking the original configuration of bigbluebutton! Like Spencer, thank you!

    • 2012/06/15 at 3:56 pm

      you must get the security salt code with:
      bbb-conf –salt
      and change the “$salt” to new security code in bbb-api-conf.php
      and url to “http://{ip address}/bigbluebutton”

  4. Jashelle
    2012/06/18 at 8:44 am

    So I tried testing it out and it gave me a fastcgi_script error: Unknown script. Any ideas?

  5. 2013/08/04 at 4:27 pm

    Way cool! Some very valid points! I appreciate you writing this article plus the rest of the website is
    really good.

  1. 2016/12/22 at 11:08 pm
  2. 2016/12/22 at 11:11 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: