How do I make PHP work with Nginx on the BBB?

650 views
Skip to first unread message

the....@gmail.com

unread,
Aug 12, 2013, 6:51:02 AM8/12/13
to beagl...@googlegroups.com
Hi guys

I'm very new to the Linux world, and I'm trying to setup a LEMP on my BBB.

So far, I have Nginx running (couldn't do it through opkg, so got it here: http://nginx.org/download/nginx-1.4.1.tar.gz).

Now, to get PHP working I've tried install php-fpm, which installs a package, but I'm not sure whether this gives me what I need to run PHP. I've seen different posts (ex.: here) on how to get PHP to work with Nginx on another distribution, but after installing php-fpm they mention files (/etc/php5/fpm/php.ini) that I do not see - nor does php -v work. Do I need to install other packages? I read that php-fpm contains a daemon process, but I have no idea whether it also includes the php framework, and what to do about that.

I think I'm missing some basic knowledge of how to install PHP. I've now seen a ton of different ways of installing it - and I have no idea about which is the right way for Nginx. I'm hoping that someone can shed some light on this.

Thanks!

/Torst

the....@gmail.com

unread,
Aug 13, 2013, 8:57:49 AM8/13/13
to beagl...@googlegroups.com, the....@gmail.com
Well, turns out you have to do the following:

1) Install PHP framework with this command:
opkg install php php-cgi php-cli

2) Install the daemon worker with this command
opkg install php-fpm

3) Make sure you have the PCRE library installed. If not, install it using command:
opkg install libpcre libpcre-dev
...and recompile Nginx, if you had to install PCRE, otherwise Nginx does not recognize PCRE.

4) In your nginx.conf, edit the fastcgi_param variable from:
SCRIPT_FILENAME  /scripts$fastcgi_script_name;
to:
SCRIPT_FILENAME  /path-to-your-site$fastcgi_script_name;

There are many tutorials on getting Nginx to serve PHP, but the above details were hard to find for me.

- Torsten

the....@gmail.com

unread,
Nov 19, 2013, 3:28:09 AM11/19/13
to beagl...@googlegroups.com, the....@gmail.com
For those of you who want the steps to do all this, they're described here: http://www.drsugus.com/beaglebone-black-web-server-lemp/

Also, that site linked to runs on the the BBB.
Reply all
Reply to author
Forward
0 new messages