XAMPPç°å¢ã§PHPããPostgreSQLã«æ¥ç¶
Windowsç°å¢ã§PHPï¼PostgreSQLãªãã®ãä½ãå¿
è¦ã«è¿«ãããã®ã§ç°å¢æ§ç¯ããã¾ãããWindowsã§PostgreSQL使ãã®ã¯ä¹
ãæ¯ãã¨ãããã¨ããããå°ãã ãèºããã®ã§ãã¡ã¢ãæ®ãã¦ããã¾ãã
PostgreSQL for Windows ã¤ã³ã¹ãã¼ã©ã®å ¥æ
PostgreSQLã¯ãªã¼ãã³ã½ã¼ã¹ãªã½ããã¦ã§ã¢ã§ãé常ã¯ã½ã¼ã¹ã³ã¼ãã§ã®é
å¸ã§ããLinuxãªã©ã®å¤ãã®ç°å¢ã§ã¯ã½ã¼ã¹ã³ã¼ãããã®ãã«ãããããã¥ã¢ã«ï¼日本語版ã»原文ï¼ã«å¾ãã°é常ã«ç°¡åã«ã§ãã¾ããããããWindowsæ©ã§ãã¡ãã¨ãããã«ãç°å¢ãæã¤ã®ã¯é常ã«é¢åèãã®ã§ããã¤ããªã§ã®é
å¸ã®ãä¸è©±ã«ãªããã¨ã«ãªãã¾ãã
注ï¼ï¼ãã¡ããRPMãªã©ã®ããã±ã¼ã¸ã§ã®é
å¸ãããã¾ãã
注ï¼ï¼Windowsã§ã®ãã«ãç°å¢ã®ç¨æã¯ãããããããç°¡åãªã®ããããã¾ããããçè
ã®é£ããå«ãã§ãã
注ï¼ï¼ããã¥ã¢ã«ï¼ãªã³ã¯ã¯åè¿°ï¼ã§ã¯ãWindowsã¦ã¼ã¶ã¯ãã¤ããªãè½ã¨ããæ¹ãè¯ãããã¨è¨ã£ã¦ãã¾ãã
Windowsåãã®ã¤ã³ã¹ãã¼ã©ãæã¯JPUGï¼æ¥æ¬PostgreSQLã¦ã¼ã¶ä¼ï¼ãã¯ããã¨ãã¦ããããªå£ä½ãé å¸ãã¦ããã®ã§ãããä»ã§ã¯JPUGã¯é å¸ãããã¦ãã¾ã£ãããã§ãããã®ããããEnterpriseDB社のサイトãããã¦ã³ãã¼ããããã¨ãå¯è½ã§ãã
ã¤ã³ã¹ãã¼ã«æ¹æ³ãããããªã人ã¯ãå°ãå¤ãã§ããã WindowsでPostgreSQLを使ってみよう — Let's Postgres ããããåèã«ããã°è¯ãããããªãããªã¨æãã¾ãã
XAMPPã®PHPããæ¥ç¶
ãã¦ãæ¬é¡ã§ãã
PHPã§æ¥ç¶ãã¹ãç¨ã®ã³ã¼ããæ¸ãã¦ãè¯ãã®ã§ãããããã§ã¯æ¥ç¶ãã¹ãã®ããã« phpPgAdmin ã使ç¨ãã¾ãï¼å¿
é ã¨ãã訳ã§ã¯ãªãã§ãããæã£ããæã£ãã§éçºã«ã¯ä¾¿å©ã§ããï¼ãå°å
¥ããã«ã¯ã
- zipçããã¦ã³ãã¼ããã¦ãã¦xamppã®htdocsé ä¸ã«è§£å
phppgadmin/conf/config.inc.php
è¨å®ãã¡ã¤ã«ããããï¼è©³ç´°ã¯å¾è¿°ï¼
ã¨ããæé ãè¸ãã°OKã
æããä¸æãè¡ããªãã ããâ¦ã¨æããªãã phpPgAdmin ã®URLãå©ãã¨ãæ¡ã®å®ã¨ã©ã¼ã«ãªãã¾ããã
â»ã¨ã©ã¼ã¡ãã»ã¼ã¸ã®è¨èªã¯ããã©ã¦ã¶ã®è¨èªè¨å®ã«ããããã§ãã
ãã¦ãã¨ã©ã¼ã¡ãã»ã¼ã¸æ°ããPHPåãã«ããã¦ãï¼ã¯ãã¨ï¼ãã ããã§ããããããªé¢åèããã¨ããããããªãXAMPPå©ç¨ãã¾ãããä»ã®å¯¾å¦æ³ãæ¢ãã¾ãããã
php.ini
php.iniï¼xampp\php\php.ini
ï¼ã®1018è¡ç®ãããã«ã次ã®ãããªè¨å®ãããã¾ãã
;extension=php_pgsql.dll
ãã®è¨å®ãã¡ã¤ã«ã§èªã¿è¾¼ãDLLã®è¨å®ããã£ã¦ãã訳ã§ãããè¦ã¦ã®éãè¡é ã«ã»ãã³ãã³ããããã³ã¡ã³ãã¢ã¦ãããã¦ãã¾ãã
ãã®ã»ãã³ãã³ãé¤å»ãã¦æå¹ã«ãã¾ããããPDOçµç±ã§ã使ãããã®ãªãããã®è¿ãã«ããphp_pdo_pgsql.dll
ãæå¹ã«ãã¨ãã¨è¯ãã§ãããã
è¨å®ãã¦ãããXAMPPã®ã³ã³ããã¼ã«ããã«ããApacheãåèµ·åãããã¨ãä»åº¦ã¯æ¬¡ã®ãããªã¨ã©ã¼ãåºã¾ããã
å
ã»ã©ã®php.iniã«æ¸ããlibpq.dll
ã®å®ä½ãè¦ã¤ãããªããã¨ãããã¨ã®ããã§ããXAMPPã®ãã£ã¬ã¯ããªãè¦ã¦ã¿ãã¨ãå®ä½ã¯xampp\php\libpq.dll
ã¨ãã¦ç½®ãã¦ããããã§ããã©ããããããã«æ¢ãã«ãã¦ããã¦ãªãããã§ãã
DLLãæ¢ãã¦ãããããã«
Windowsã§ã¯é常ï¼æ示ããªãå ´åï¼ãDLLã¯ç°å¢å¤æ°PATHãæãã¦ããå ´æãæ¢ãã«ããããã§ãããªã®ã§PATHã«xampp\php\
ï¼ãã¡ããå®éã¯çµ¶å¯¾ãã¹ï¼ã追å ããã°OKã§ãã注æããªããã°ãªããªãã®ã¯ããã®PATHã®è¨å®ãããå¾ã¯Apacheã®åèµ·åã§ã¯ãªãã¦XAMPPã³ã³ããæ¬ä½ã®åèµ·åãå¿
è¦ã ã¨ãããã¨ã§ãã
â»PATHãè¨å®ããªãã¦ãphp_pgsql.dll
ãèªãã¦ããã®ã¯ãphpï¼Windowsçãã¤ããªï¼ã®ä¸ã§ãext
ãã£ã¬ã¯ããªã®ä¸ãæ¢ç´¢ããããã«çµã¿è¾¼ã¾ãã¦ããã®ã§ãããããã£ã¨ï¼ã½ã¼ã¹ã¯åï¼ã
ããã¾ã§ä¸éãè¨å®ããã¨ãXAMPPããApacheã®èµ·åãæåããphpPgAdminã®ç»é¢ããã¬ã¤ã«è¦ãã¾ãããã°ã¤ã³ãã§ãã¾ããã
éçºç°å¢ã¨ãã¦ã¯ãããã§ååã§ããã
phppgadmin/conf/config.inc.php
è¨å®ãã¡ã¤ã«ã§ããã¹ããã¨
- æ¥ç¶ããããµã¼ãã®æ
å ±ã
$conf['servers'][0]['host']
ãªã©ã®é£æ³é åã«ä¸ãã¦ããã - ããã
postgres
ã¦ã¼ã¶ãªã©ã®ç¹æ¨©ã¦ã¼ã¶ã§æ¥ç¶ãããã®ãªãã$conf['extra_login_security']
ãfalse
ã«ãã¦ããã
ã¨ããè¨å®å¤æ´ãå¿
è¦ã§ããç¹ã«å¾è
ã®ãã¨ã¯å¿ããã¡ãªã®ã§åããã¦ã¡ã¢ãã¦ããã¾ãããï¼ãã¡ãããå¤é¨ã«å
¬éãã¦ãããµã¼ãã§ãããªå±éºãªè¨å®ãå
¥ããããã¡ããã¡ã§ããï¼ã
ãã¼ã¸ã§ã³æ å ±
- Windows 7 Home (64bits)
- XAMPP 1.8.2
- PostgreSQL 9.3.2
- phpPgAdmin 5.1ï¼â»phpPgAdmin5.1ã¯PostgreSQL9.3ãå ¬å¼ã«ã¯ãµãã¼ããã¦ãã¾ããï¼