Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Server 5.2 php not loading pgsql.so module

After installing macOS Sierra and Server 5.2, I find that Roundcube is no longer able to connect to its PostgreSQL database. I've traced it down to the php.ini configuration does not load the pdo_pgsql.so/pgsql.so modules. Has anyone else noticed this change?


I see that Server still has it's own php.ini file with pgsql extension settings in it. However, the php configuration no longer loads Server's php.ini file, as it seemed to previously. How might I make php load in Server's php.ini file?

Mac mini (Late 2012), macOS Sierra (10.12)

Posted on Sep 22, 2016 9:08 PM

Reply
5 replies

Sep 23, 2016 8:08 PM in response to hasenpfeffer2

It looks like the root cause is that Apple did not compile their PHP on Sierra with the '--with-config-file-scan-dir=/Library/Server/Web/Config/php/' configure command, as it was on El Capitan. This results in the /Library/Server/Web/Config/php/php.ini configure settings not being loaded.


The simple workaround for me was to append the contents of /Library/Server/Web/Config/php/php.ini to the end of /etc/php.ini. Then restart the web server and voila! Roundcube now connects to the database. You can also verify that pdo_pgsql.so/pgsql.so are indeed loading using the 'php -i' command.


If Apple corrects their mistake in a future update, then I'll have to try and remember to remove the appended part of php.ini. On the plus side, Apple DID recompile pdo_pgsql.so/pgsql.so for the new PHP version, so that's good.


BUT! There's always a but 😟 The new PHP 5.6 now defaults to checking TLS certificate chains, so even though Roundcube connects to the database, it doesn't authenticate to the mail server over TLS anymore and just throws an error when logging in. See here: http://www.roundcubeforum.net/index.php?topic=22035.0


I haven't got that part working yet, but that's a new topic.

Sep 26, 2016 5:53 AM in response to hasenpfeffer2

I will just say Apple!!!


The question is why when I did update of Server app, the app didn't check my php version ? and replaced the php module for php 5.6 instead of for php 5.5


I updated only Server app and I using OS X Capitan with Server App 5.2, and during the upgrade the App should do a little check of my php which never did and just crashed


So then I needed manual to find pgsql modules and to back/edit the path on php.ini


For people who have this problems


You have to do that:


1. cd /Library/Server/Web/Config/php


2. cat php.ini

you should see something like it

extension=/Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/no -debug-non-zts-20131226/pdo_pgsql.so

This module is for php 5.6, I using by default of Capitan 5.5

Just comment this two line and add this new line

extension=/Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/no -debug-non-zts-20121212/pdo_pgsql.so

extension=/Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/no -debug-non-zts-20121212/pgsql.so

Now I'll provide a link with right php module which I zip from another OS X Capitan system which running well with php 5.5

Download php modules which you need from here https://goo.gl/OchQK5

Unzip zip file in /Applications/Server.app/Contents/ServerRoot/usr/lib/php/extensions/

Then restart web services with your Server App and everything should be working fine

I never, never got any of the server which I doing Administration with OS X to be fine after any OS X update

And Still asking Why ? Why ? It's very simple thing ! Just The app needed to check my php version and to post the right php module in this case just to don't touch them and that is, but I'll just say "Apple"

The world marketing company !

Server 5.2 php not loading pgsql.so module

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.