How to configure nginx postgresql php on FreeBSD 10

It's actually not much different from setting this up on any other operating system.

Basically you'd want to install www/nginx and databases/php56-pgsql to begin with. Because of its dependencies the latter port will also pull in PHP and a PostgreSQL client (for example databases/postgresql95-client). Then all that's left to do is to install the right server version.

Installing software should be pretty trivial stuff, check out chapter 4 of the handbook if it isn't, it will explain the full process.

Keep in mind though that installing pre-compiled ("binary") packages will set them up with all default settings. Compiling them yourself through the ports collection will also allow you to set up certain compilation settings.
 
Installing software should be pretty trivial stuff, check out chapter 4 of the handbook if it isn't, it will explain the full process.

I had a helluva job trying to get the latest version postgresql working with the latest php. After installing postgresql 9.6, php5.6 immediately deleted postgresql96-client, insisting that 9.5 be used. Then when I tried installing php7.1 I came across a whole new battleground. It is doable, but I would hardly call it a trivial task. My experience was several months ago, so things may have changed over that period.
 
I had a helluva job trying to get the latest version postgresql working with the latest php. After installing postgresql 9.6, php5.6 immediately deleted postgresql96-client, insisting that 9.5 be used. Then when I tried installing php7.1 I came across a whole new battleground. It is doable, but I would hardly call it a trivial task.
You need to set the correct defaults or you'll keep battling with this. See /usr/ports/Mk/bsd.default-versions.mk:

/etc/make.conf
Code:
DEFAULT_VERSIONS+= php=7.1 pgsql=9.6

Note that the official packages are always built using the default settings and options. If you want or need to deviate from the defaults you'll need to build from ports (or set up your own repository).
 
That's a specific module, your sentence "php5.6 immediately deleted postgresql96-client" implied it was lang/php56 that deleted PostgreSQL. And that's certainly not the case.
 
Back
Top