{"id":3306,"date":"2014-08-23T15:10:23","date_gmt":"2014-08-23T06:10:23","guid":{"rendered":"http:\/\/www.lancard.com\/blog\/?p=3306"},"modified":"2025-03-12T11:28:44","modified_gmt":"2025-03-12T02:28:44","slug":"phpenv-%e3%81%a7%e5%85%a5%e3%82%8c%e3%81%9f-php-%e3%81%ab-pdo_pgsql-%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.lancard.com\/blog\/2014\/08\/23\/phpenv-%e3%81%a7%e5%85%a5%e3%82%8c%e3%81%9f-php-%e3%81%ab-pdo_pgsql-%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab\/","title":{"rendered":"phpenv \u3067\u5165\u308c\u305f PHP \u306b pdo_pgsql \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>\u5b9f\u969b\u306f\u524d\u306e\u8a18\u4e8b\u306e\u524d\u306b\u3084\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u52d5\u304b\u3057\u305f\u3044\u30bd\u30d5\u30c8\u304c\u4f7f\u3063\u3066\u3044\u305f\u306e\u306fpdo_pgsql\u3058\u3083\u306a\u304b\u3063\u305f\u306e\u3067\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u74b0\u5883\u306f\u524d\u306e\u8a18\u4e8b\u3068\u540c\u3058\u3067Postgres.app\u3092\u4f7f\u7528\u3057\u3066\u3066PostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f9.3.5.0\u3002\u5bfe\u8c61\u306ePHP\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306f5.5.14\u3067\u3059\u3002anyenv\u3082\u304b\u3089\u3093\u3067\u3044\u308b\u306e\u3067phpenv\u5358\u72ec\u306e\u5834\u5408\u3068\u306f\u5c11\u3057\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u304c\u9055\u3046\u70b9\u306b\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u4f5c\u696d\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/qiita.com\/ryurock\/items\/ed7c86d3a7c183c76081\" target=\"_blank\">.phpenv\u3067\u5165\u308c\u305f\u5834\u5408\u306epecl\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u8ffd\u52a0\u65b9\u6cd5<\/a><\/p>\n<p>\u307e\u305a\u306fpecl\u306e\u30b5\u30a4\u30c8\u304b\u3089pdo_pgsql\u3092\u53d6\u3063\u3066\u304d\u3066\u89e3\u51cd\u3002<\/p>\n<pre lang=\"bash\">\r\n$ cd tmp\r\n$ wget http:\/\/pecl.php.net\/get\/PDO_PGSQL-1.0.2.tgz\r\n$ tar zxvf PDO_PGSQL-1.0.2.tgz\r\n$ cd PDO_PGSQL-1.0.2\r\n<\/pre>\n<p>\u307a\u3061\u3071\u3044\u305a(\u8aad\u307f\u65b9\u4e0d\u660e)\u3060\uff01<\/p>\n<pre lang=\"bash\">\r\n$ phpize\r\n<\/pre>\n<p>\u3053\u3093\u3075\u3043\u304e\u3085\u3042\u3057\u3066\u3081\u3044\u304f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre lang=\"bash\">\r\n$ .\/configure --with-pdo-pgsql=\/Applications\/Postgres.app\/Contents\/Versions\/9.3\/bin\r\n$ make\r\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089<\/p>\n<pre lang=\"bash\">\r\n$ make test\r\n<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<\/p>\n<pre lang=\"bash\">\r\n$ make install\r\n<\/pre>\n<p>\u6709\u52b9\u5316\u3059\u308b\u305f\u3081\u306bpdo_pgsq\u306e\u305f\u3081\u306eini\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3002<\/p>\n<pre lang=\"bash\">\r\n$ vim \/Users\/murave\/.anyenv\/envs\/phpenv\/versions\/5.5.14\/etc\/conf.d\/pdo_pgsql.ini\r\n<\/pre>\n<p>\u5185\u5bb9\u3002<\/p>\n<pre lang=\"bash\">\r\nextension=pdo_pgsql.so\r\n<\/pre>\n<p>php.ini\u306b\u76f4\u63a5\u8ffd\u52a0\u3057\u3066\u3082\u3044\u3044\u3051\u3069php.ini\u304c\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u3066\u6ce3\u3044\u305f\u308a\u3059\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u304b\u3089\u5206\u3051\u3066\u304a\u304f\u3068\u3044\u3044\u3068\u601d\u3046(\u7d4c\u9a13\u8005)\u3002<\/p>\n<p>\u78ba\u8a8d\u3002<\/p>\n<pre lang=\"bash\">\r\n$ php -i | grep pdo_pgsql\r\n<\/pre>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3306&#038;t=phpenv%20%E3%81%A7%E5%85%A5%E3%82%8C%E3%81%9F%20PHP%20%E3%81%AB%20pdo_pgsql%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3306&#038;p&#091;images&#093;&#091;0&#093;=&#038;p&#091;title&#093;=phpenv%20%E3%81%A7%E5%85%A5%E3%82%8C%E3%81%9F%20PHP%20%E3%81%AB%20pdo_pgsql%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"http:\/\/twitter.com\/share?url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3306&#038;text=phpenv%20%E3%81%A7%E5%85%A5%E3%82%8C%E3%81%9F%20PHP%20%E3%81%AB%20pdo_pgsql%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3306&#038;title=phpenv%20%E3%81%A7%E5%85%A5%E3%82%8C%E3%81%9F%20PHP%20%E3%81%AB%20pdo_pgsql%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-tumblr nolightbox\" data-provider=\"tumblr\" target=\"_blank\" rel=\"nofollow\" title=\"Share on tumblr\" href=\"https:\/\/tumblr.com\/share?s=&#038;v=3&#038;t=phpenv%20%E3%81%A7%E5%85%A5%E3%82%8C%E3%81%9F%20PHP%20%E3%81%AB%20pdo_pgsql%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&#038;u=https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3306\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"tumblr\" title=\"Share on tumblr\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/tumblr.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-24 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=phpenv%20%E3%81%A7%E5%85%A5%E3%82%8C%E3%81%9F%20PHP%20%E3%81%AB%20pdo_pgsql%20%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB&#038;body=%E3%82%B7%E3%82%A7%E3%82%A2%E3%81%99%E3%82%8B%EF%BC%9A:%20https%3A%2F%2Fwww.lancard.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F3306\" style=\"font-size: 0px;width:24px;height:24px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"24\" height=\"24\" style=\"display: inline;width:24px;height:24px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.lancard.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/48x48\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>\u5b9f\u969b\u306f\u524d\u306e\u8a18\u4e8b\u306e\u524d\u306b\u3084\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u52d5\u304b\u3057\u305f\u3044\u30bd\u30d5\u30c8\u304c\u4f7f\u3063\u3066\u3044\u305f\u306e\u306fpdo_pgsql\u3058\u3083\u306a\u304b\u3063\u305f\u306e\u3067\u3042\u308a\u307e\u3057\u305f\u3002 \u3068\u3044\u3046\u3053\u3068\u3067\u3001\u74b0\u5883\u306f\u524d\u306e\u8a18\u4e8b\u3068\u540c\u3058\u3067Postgres.app\u3092\u4f7f\u7528\u3057\u3066\u3066PostgreSQL\u306e\u30d0\u30fc\u30b8\u30e7 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,13],"tags":[],"class_list":["post-3306","post","type-post","status-publish","format-standard","hentry","category-php","category-postgresql"],"_links":{"self":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/comments?post=3306"}],"version-history":[{"count":5,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3306\/revisions"}],"predecessor-version":[{"id":3311,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/posts\/3306\/revisions\/3311"}],"wp:attachment":[{"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/media?parent=3306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/categories?post=3306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lancard.com\/blog\/wp-json\/wp\/v2\/tags?post=3306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}