{"id":18,"date":"2016-10-16T19:07:29","date_gmt":"2016-10-16T19:07:29","guid":{"rendered":"http:\/\/www.christophervickery.com\/Notes\/?p=18"},"modified":"2016-10-17T02:44:58","modified_gmt":"2016-10-17T02:44:58","slug":"macos-sierra-apache-and-postgres","status":"publish","type":"post","link":"https:\/\/www.christophervickery.com\/Notes\/index.php\/2016\/10\/16\/macos-sierra-apache-and-postgres\/","title":{"rendered":"MacOS Sierra, Apache, and Postgres"},"content":{"rendered":"<p>I upgraded my office workstation from El Capitan to Sierra last week after waiting a while to make sure there were no problems with the new version of the operating system: my office workstation is used for some campus-wide services, and I go into panic mode when upgrades break things. So after a decent interval it seemed safe to let the upgrade go forward.<\/p>\n<p>Panic mode.<\/p>\n<p>It&#8217;s a little embarrassing in hindsight how long it took me to recover from the upgrade, but there were no indications whatsoever what had gone wrong: just a cryptic HTTP 500 error code for part of one of the two virtual hosts on the system. Lots of time looking at mail configuration; PHP\u00a0<em>include_path<\/em>, etc. Finally: \u201cpg_connect() not found.\u201d I wasn\u2019t getting my \u201cunable to connect to database\u201d error because &#8230; postgres wasn\u2019t available at all. The connection couldn\u2019t fail because the code to make the connection couldn\u2019t even be executed.<\/p>\n<p>I\u2019m not the only one to have the problem, of course, and I finally was able to google the correct problem. The solution was simple, just add these two lines to\u00a0<em>php.ini<\/em>:<\/p>\n<p><code>extension=\/Applications\/Server.app\/Contents\/ServerRoot\/usr\/lib\/php\/extensions\/no-debug-non-zts-20131226\/pdo_pgsql.so<br \/>\nextension=\/Applications\/Server.app\/Contents\/ServerRoot\/usr\/lib\/php\/extensions\/no-debug-non-zts-20131226\/pgsql.so<br \/>\n<\/code><\/p>\n<p>Since I don\u2019t use the PDO interface to Postgres, I probably need only the second line, but I didn\u2019t do the experiment to make sure.<\/p>\n<p>So now I\u2019m back to the old problem: when Apple updates the OS, the path to <em>pgsql.so<\/em> will undoubtedly change without documentation (that I know of) to alert me to the new path, just as the demotion of Postgres being included in the PHP installation by default was discontinued without documentation (that I know of).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I upgraded my office workstation from El Capitan to Sierra last week after waiting a while to make sure there were no problems with the new version of the operating system: my office workstation is used for some campus-wide services, and I go into panic mode when upgrades break things. So after a decent interval [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[2],"tags":[],"class_list":["post-18","post","type-post","status-publish","format-standard","hentry","category-site-admin"],"share_on_mastodon":{"url":"","error":""},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/posts\/18","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":4,"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":22,"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/posts\/18\/revisions\/22"}],"wp:attachment":[{"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.christophervickery.com\/Notes\/index.php\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}