弁財天

ゴフマン「専門家を信じるのではなく、自分自身で考えて判断せよ」

Use of assignment to $[ is deprecated at /usr/sbin/apxs line 85.

最新のCygwinにphp-5.2.17にバックポートパッチを当てた環境を構築してみる。

[~]$ uname -a
CYGWIN_NT-5.1 localhost 1.7.16(0.262/5/3) 2012-07-20 22:55 i686 Cygwin
[~]$
[~/src/php-5.2.17]$ sh C
loading cache ./config.cache
checking for Cygwin environment... (cached) no
略
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... Use of assignment to $[ is deprecated at /usr/sbin/apxs line 85.
Use of assignment to $[ is deprecated at /usr/sbin/apxs line 85.
apxs:Error: Invalid query string `BINDIR'
Use of assignment to $[ is deprecated at /usr/sbin/apxs line 85.
Use of assignment to $[ is deprecated at /usr/sbin/apxs line 85.
Use of assignment to $[ is deprecated at /usr/sbin/apxs line 85.

Diff of /httpd/httpd/trunk/support/apxs.in

略
checking for Apache 2.0 filter-module support via DSO through APXS... no
checking for Apache 2.0 handler-module support via DSO through APXS... apxs:Error: Invalid query string `BINDIR'
apxs:Error: Invalid query string `MPM_NAME'
apxs:Error: Invalid query string `APU_BINDIR'
apxs:Error: Invalid query string `APR_BINDIR'
./configure: line 6479: /apr-config: No such file or directory
./configure: line 6480: /apu-config: No such file or directory
configure: error: You have enabled Apache 2 support while your server is Apache 1.3.  Please use the appropiate switch --with-apxs (without the 2)
[~/src/php-5.2.17]$

checking libxml2 install dir... no
checking for xml2-config path... (cached) /usr/bin/xml2-config
configure: error: xml2-config not found. Please check your libxml2 installation.
libxml2-develを導入

checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
    easy.h should be in /include/curl/
libcurl-develを導入

checking for jpeg_read_header in -ljpeg... (cached) yes
configure: error: libpng.(a|so) not found.
libpngは既に導入されてる
Cygwinはlibpng-1.4/libpng-1.5で新しいライブラリしかないので古いlibpng-1.2.xを調達してビルドする必要がある。
[~/src/php-5.2.17]$ ls /usr/lib/libpng*
/usr/lib/libpng.dll.a  /usr/lib/libpng.la  /usr/lib/libpng14.dll.a  /usr/lib/libpng14.la  /usr/lib/libpng15.dll.a  /usr/lib/libpng15.la
[~/src/php-5.2.17]$
configure: error: libpng.(a|so) not found (Errors & Solutions #13)

[~/src/php-5.2.17]$ ./configure  -with-zlib-dir=/usr/lib --enable-mbstring --with-apxs=/usr/sbin/apxs --with-gd --with-jpeg-dir --with-png-dir=/usr/local/lib --with-curl --with-pgsql --enable-zip
loading cache ./config.cache
checking for Cygwin environment... (cached) no

略

Generating files
updating cache ./config.cache
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
creating sapi/cli/php.1
creating main/php_config.h
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

[~/src/php-5.2.17]$

-lcrypto -lz -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lcrypt -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lcrypt  -o sapi/cli/php
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
ext/date/.libs/php_date.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Makefile:240: recipe for target `sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1
[~/src/php-5.2.17]$
何これx86_64環境の残骸みたい。make clean

-lssh2 -lssl -lcrypto -lz -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lcrypt -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lxml2 -lz -liconv -lm -lcrypt  -o sapi/cli/php
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
ext/gd/libgd/.libs/gd_png.o: In function `gdPngWriteData':
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:83: undefined reference to `_png_get_io_ptr'
ext/gd/libgd/.libs/gd_png.o: In function `gdPngErrorHandler':
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:63: undefined reference to `_png_get_error_ptr'
ext/gd/libgd/.libs/gd_png.o: In function `gdPngReadData':
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:75: undefined reference to `_png_get_io_ptr'
ext/gd/libgd/.libs/gd_png.o: In function `php_gd_gdImageCreateFromPngCtx':
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:142: undefined reference to `_png_check_sig'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:147: undefined reference to `_png_create_read_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:156: undefined reference to `_png_create_info_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:181: undefined reference to `_png_set_sig_bytes'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:183: undefined reference to `_png_set_read_fn'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:184: undefined reference to `_png_read_info'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:186: undefined reference to `_png_get_IHDR'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:270: undefined reference to `_png_get_valid'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:271: undefined reference to `_png_get_tRNS'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:312: undefined reference to `_png_read_update_info'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:315: undefined reference to `_png_get_rowbytes'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:325: undefined reference to `_png_read_image'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:326: undefined reference to `_png_read_end'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:349: undefined reference to `_png_destroy_read_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:226: undefined reference to `_png_get_PLTE'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:230: undefined reference to `_png_get_valid'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:238: undefined reference to `_png_get_tRNS'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:297: undefined reference to `_png_get_valid'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:298: undefined reference to `_png_get_tRNS'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:204: undefined reference to `_png_set_packing'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:202: undefined reference to `_png_set_strip_16'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:253: undefined reference to `_png_destroy_read_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:213: undefined reference to `_png_destroy_read_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:159: undefined reference to `_png_destroy_read_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:194: undefined reference to `_png_destroy_read_struct'
ext/gd/libgd/.libs/gd_png.o: In function `php_gd_gdImagePngCtxEx':
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:472: undefined reference to `_png_create_write_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:481: undefined reference to `_png_create_info_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:498: undefined reference to `_png_set_write_fn'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:510: undefined reference to `_png_set_compression_level'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:512: undefined reference to `_png_set_filter'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:740: undefined reference to `_png_destroy_write_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:567: undefined reference to `_png_set_IHDR'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:576: undefined reference to `_png_set_tRNS'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:650: undefined reference to `_png_write_info'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:653: undefined reference to `_png_set_packing'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:706: undefined reference to `_png_write_image'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:707: undefined reference to `_png_write_end'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:623: undefined reference to `_png_set_tRNS'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:646: undefined reference to `_png_set_PLTE'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:725: undefined reference to `_png_write_image'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:726: undefined reference to `_png_write_end'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:734: undefined reference to `_png_write_image'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:735: undefined reference to `_png_write_end'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:484: undefined reference to `_png_destroy_write_struct'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:706: undefined reference to `_png_write_image'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:707: undefined reference to `_png_write_end'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:725: undefined reference to `_png_write_image'
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:726: undefined reference to `_png_write_end'
ext/gd/libgd/.libs/gd_png.o: In function `gdPngReadData':
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:77: undefined reference to `_png_error'
ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:348: undefined reference to `_iconv'
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:385: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:626: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:747: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_encode':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:1128: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o:/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:1160: more undefined references to `_iconv' follow
ext/pgsql/.libs/pgsql.o: In function `zif_pg_send_prepare':
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:4181: undefined reference to `_PQsendPrepare'
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:4185: undefined reference to `_PQsendPrepare'
ext/pgsql/.libs/pgsql.o: In function `zif_pg_prepare':
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:1398: undefined reference to `_PQprepare'
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:1402: undefined reference to `_PQprepare'
collect2: ld returned 1 exit status
Makefile:240: recipe for target `sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1
[~/src/php-5.2.17]$
-lpng と -liconv と -lpqがエラー?こんなのありえないだろ。
どうもx86_64環境でconfigureしたディレクトリをCygwinに持って来たのがマズいようだ。
新しいディレクトリにphp-5.2.17.tar.bz2を展開してバックポートパッチを当てるとこからやり直し。

/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
ext/gd/libgd/.libs/gd_png.o: In function `php_gd_gdImageCreateFromPngCtx':
/home/Administrator/src/php-5.2.17/ext/gd/libgd/gd_png.c:142: undefined reference to `_png_check_sig'
ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:348: undefined reference to `_iconv'
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:385: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:626: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o: In function `_php_iconv_substr':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:747: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_encode':
/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:1128: undefined reference to `_iconv'
ext/iconv/.libs/iconv.o:/home/Administrator/src/php-5.2.17/ext/iconv/iconv.c:1160: more undefined references to `_iconv' follow
ext/pgsql/.libs/pgsql.o: In function `zif_pg_send_prepare':
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:4181: undefined reference to `_PQsendPrepare'
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:4185: undefined reference to `_PQsendPrepare'
ext/pgsql/.libs/pgsql.o: In function `zif_pg_prepare':
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:1398: undefined reference to `_PQprepare'
/home/Administrator/src/php-5.2.17/ext/pgsql/pgsql.c:1402: undefined reference to `_PQprepare'
collect2: ld returned 1 exit status
Makefile:240: recipe for target `sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1
このリンクエラーはどうにもならない。
なのでphp-5.3.17に切り替え。するとサクッとビルドに成功。
./configure -with-zlib-dir=/usr/lib --enable-mbstring --with-apxs=/usr/sbin/apxs --with-gd --with-jpeg-dir --with-png-dir=/usr/local/lib --with-curl --with-pgsql --enable-zip --with-iconv-dir --disable-phar

[~/src/php-5.3.17]$ make install
Installing PHP SAPI module:       apache
apxs:Error: file libs/libphp5.so is not a DSO
Makefile:146: recipe for target `install-sapi' failed
make: *** [install-sapi] Error 1
[~/src/php-5.3.17]$
[技術ネタ] cygwin上でphp-5を構築したメモ Re: php5 on cygwin Re: php5 on cygwin

なんだCygwin Ports projectにバイナリがあるじゃーん。

投稿されたコメント:

コメント
コメントは無効になっています。