blog.notmyidea.org/system/php5-nginx.rst
Alexis Metaireau bd72122b70 update the categories
--HG--
rename : associatif/amap-medias-paniers-bio-a-5e.rst => asso/amap-medias-paniers-bio-a-5e.rst
rename : associatif/le-temps-de-graces-courrez-y.rst => asso/le-temps-de-graces-courrez-y.rst
rename : associatif/semaine-de-lenvironnement-consommation-etudiante.rst => asso/semaine-de-lenvironnement-consommation-etudiante.rst
rename : python/a-distutils2-gsoc.rst => dev/a-distutils2-gsoc.rst
rename : python/a-distutils2-month-pypi-simple-index-ready.rst => dev/a-distutils2-month-pypi-simple-index-ready.rst
rename : python/a-distutils2-sprint-in-tours.rst => dev/a-distutils2-sprint-in-tours.rst
rename : python/an-amazing-summer-of-code-working-on-distutils2.rst => dev/an-amazing-summer-of-code-working-on-distutils2.rst
rename : misc/bebox-reboot.rst => dev/bebox-reboot.rst
rename : python/distutils2-paris-sprint-wrapup.rst => dev/distutils2-paris-sprint-wrapup.rst
rename : python/distutils2-paris-sprint.rst => dev/distutils2-paris-sprint.rst
rename : python/dynamically-change-your-gnome-wallpapers.rst => dev/dynamically-change-your-gnome-wallpapers.rst
rename : python/gsoc-distutils-first-report.rst => dev/gsoc-distutils-first-report.rst
rename : python/pypioncouch.rst => dev/pypioncouch.rst
rename : python/python-go.rst => dev/python-go.rst
rename : misc/use-restructured-text-rest-to-power-your-presentations.rst => dev/use-restructured-text-rest-to-power-your-presentations.rst
rename : python/writing-pelican.rst => dev/writing-pelican.rst
rename : freebsd/php5-nginx.rst => system/php5-nginx.rst
2011-02-17 22:36:15 +00:00

56 lines
1.4 KiB
ReStructuredText

How to install NGINX + PHP 5.3 on FreeBSD.
##########################################
:date: 2010-10-10
I've not managed so far to get completely rid of php, so here's a simple
reminder about how to install php on NGINX, for FreeBSD. Nothing hard, but
that's worse to have the piece of configuration somewhere !
::
# update the ports
$ portsnap fetch update
# install php5 port
$ make config-recursive -C /usr/ports/lang/php5-extensions
$ make package-recursive -C /usr/ports/lang/php5-extensions
# install nginx
$ make config-recursive -C /usr/ports/www/nginx-devel
$ make package-recursive -C /usr/ports/www/nginx-devel
Now we have all the dependencies installed, we need to configure a bit the
server.
That's a simple thing in fact, but it could be good to have something that will
work without effort over time.
Here's a sample of my configuration::
server {
server_name ndd;
set $path /path/to/your/files;
root $path;
location / {
index index.php;
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
access_log off;
expires 30d;
}
location ~ .php$ {
fastcgi_param SCRIPT_FILENAME $path$fastcgi_script_name;
fastcgi_pass backend;
include fastcgi_params;
}
}
upstream backend {
server 127.0.0.1:9000;
}
And that's it !