前述の libpq-fe.h が見つからないという件は、その直前に pg_config が見つからないというエラーが出ていたところに注目。
コマンドを見つけきれないらしい。実体は /Library/PostgreSQL/9.3/bin の下にあるんだが。
そこで、探しやすいように、ln -s /Library/PostgreSQL/9.3/bin/pg_config /usr/bin としてあげたら、あっさり成功。
うまくいったようだ。
あとは make install して、モジュールを確認。
できてる。
あとは、/etc/php.ini で 二つの extension {pdo_pgsql.so, pgsql.so} を指定して、 apache を再起動すればいいはず。
phpinfo() なページを表示させてみる。
でてた!
1泊2日かかったよ。これに。
コマンドを見つけきれないらしい。実体は /Library/PostgreSQL/9.3/bin の下にあるんだが。
そこで、探しやすいように、ln -s /Library/PostgreSQL/9.3/bin/pg_config /usr/bin としてあげたら、あっさり成功。
# ./configure --with-pdo-pgsql checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for a sed that does not truncate output... /usr/bin/sed checking for cc... cc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether cc accepts -g... yes checking for cc option to accept ISO C89... none needed checking how to run the C preprocessor... cc -E checking for icc... no checking for suncc... no checking whether cc understands -c and -o together... yes checking for system library directory... lib checking if compiler supports -R... no checking if compiler supports -Wl,-rpath,... yes checking build system type... i386-apple-darwin13.0.0 checking host system type... i386-apple-darwin13.0.0 checking target system type... i386-apple-darwin13.0.0 checking for PHP prefix... /usr checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20100525 checking for PHP installed headers prefix... /usr/include/php checking if debug is enabled... no checking if zts is enabled... no checking for re2c... re2c checking for re2c version... 0.13.5 (ok) checking for gawk... no checking for nawk... no checking for awk... awk checking if awk is broken... no checking for PostgreSQL support for PDO... yes, shared checking for pg_config... /usr/bin/pg_config checking for openssl dependencies... no checking for PQparameterStatus in -lpq... yes checking for PQprepare in -lpq... yes checking for PQescapeStringConn in -lpq... yes checking for PQescapeByteaConn in -lpq... yes checking for pg_encoding_to_char in -lpq... yes checking for PDO includes... checking for PDO includes... /usr/include/php/ext checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm checking whether ln -s works... yes checking how to recognize dependent libraries... pass_all checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking the maximum length of command line arguments... 196608 checking command to parse /usr/bin/nm output from cc object... ok checking for objdir... .libs checking for ar... ar checking for ranlib... ranlib checking for strip... strip checking for dsymutil... dsymutil checking for nmedit... nmedit checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking if cc supports -fno-rtti -fno-exceptions... yes checking for cc option to produce PIC... -fno-common checking if cc PIC flag -fno-common works... yes checking if cc static flag -static works... no checking if cc supports -c -o file.o... yes checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin13.0.0 dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no creating libtool appending configuration tag "CXX" to libtool configure: creating ./config.status config.status: creating config.h config.status: config.h is unchanged bash-3.2# make /bin/sh /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/include/php/ext -I. -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -DPHP_ATOM_INC -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/include -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/main -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Library/PostgreSQL/9.3/include -DHAVE_CONFIG_H -g -O2 -c /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/pdo_pgsql.c -o pdo_pgsql.lo mkdir .libs cc -I/usr/include/php/ext -I. -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -DPHP_ATOM_INC -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/include -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/main -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Library/PostgreSQL/9.3/include -DHAVE_CONFIG_H -g -O2 -c /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/pdo_pgsql.c -fno-common -DPIC -o .libs/pdo_pgsql.o /bin/sh /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/include/php/ext -I. -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -DPHP_ATOM_INC -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/include -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/main -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Library/PostgreSQL/9.3/include -DHAVE_CONFIG_H -g -O2 -c /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/pgsql_driver.c -o pgsql_driver.lo cc -I/usr/include/php/ext -I. -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -DPHP_ATOM_INC -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/include -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/main -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Library/PostgreSQL/9.3/include -DHAVE_CONFIG_H -g -O2 -c /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/pgsql_driver.c -fno-common -DPIC -o .libs/pgsql_driver.o /bin/sh /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/include/php/ext -I. -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -DPHP_ATOM_INC -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/include -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/main -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Library/PostgreSQL/9.3/include -DHAVE_CONFIG_H -g -O2 -c /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/pgsql_statement.c -o pgsql_statement.lo cc -I/usr/include/php/ext -I. -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -DPHP_ATOM_INC -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/include -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/main -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Library/PostgreSQL/9.3/include -DHAVE_CONFIG_H -g -O2 -c /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/pgsql_statement.c -fno-common -DPIC -o .libs/pgsql_statement.o /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/pgsql_statement.c:561:9: warning: case value not in enumerated type 'enum pdo_param_type' [-Wswitch] case PDO_PARAM_INPUT_OUTPUT: ^ /usr/include/php/ext/pdo/php_pdo_driver.h:79:33: note: expanded from macro 'PDO_PARAM_INPUT_OUTPUT' #define PDO_PARAM_INPUT_OUTPUT 0x80000000 ^ 1 warning generated. /bin/sh /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/libtool --mode=link cc -DPHP_ATOM_INC -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/include -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/main -I/Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/Library/PostgreSQL/9.3/include -DHAVE_CONFIG_H -g -O2 -o pdo_pgsql.la -export-dynamic -avoid-version -prefer-pic -module -rpath /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/modules pdo_pgsql.lo pgsql_driver.lo pgsql_statement.lo -Wl,-rpath,/Library/PostgreSQL/9.3/lib -L/Library/PostgreSQL/9.3/lib -lpq cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/pdo_pgsql.so -bundle .libs/pdo_pgsql.o .libs/pgsql_driver.o .libs/pgsql_statement.o -L/Library/PostgreSQL/9.3/lib -lpq -Wl,-rpath -Wl,/Library/PostgreSQL/9.3/lib dsymutil .libs/pdo_pgsql.so || : creating pdo_pgsql.la (cd .libs && rm -f pdo_pgsql.la && ln -s ../pdo_pgsql.la pdo_pgsql.la) /bin/sh /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/libtool --mode=install cp ./pdo_pgsql.la /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/modules cp ./.libs/pdo_pgsql.so /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/modules/pdo_pgsql.so cp ./.libs/pdo_pgsql.lai /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/modules/pdo_pgsql.la ---------------------------------------------------------------------- Libraries have been installed in: /Users/bear/Downloads/php-5.4.20/ext/pdo_pgsql/modules If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable during execution See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- Build complete. Don't forget to run 'make test'. |
うまくいったようだ。
あとは make install して、モジュールを確認。
# make install Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20100525/ # ls /usr/lib/php/extensions/ no-debug-non-zts-20100525 bash-3.2# ls /usr/lib/php/extensions/no-debug-non-zts-20100525/ pdo_pgsql.so pgsql.so xdebug.so |
できてる。
あとは、/etc/php.ini で 二つの extension {pdo_pgsql.so, pgsql.so} を指定して、 apache を再起動すればいいはず。
extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20100525/" extension = pgsql.so extension = pdo_pgsql.so |
phpinfo() なページを表示させてみる。
でてた!
1泊2日かかったよ。これに。