显示标签为“php扩展”的博文。显示所有博文
显示标签为“php扩展”的博文。显示所有博文

2013年7月25日星期四

[转] Building ImageMagick on OSX Lion and can't link libpng

Building ImageMagick on OSX Lion and can't link libpng

Q:
I am trying to build ImageMagick 6.8.0-5 on OSX Lion with support for libpng. I am just using the standard ./configure make make install procedure.
I succeed in compiling when I do not reference libpng.
./configure --with-png=no
make
However, I get an error in make when I try to add libpng support. (libpng-1.5.13)
./configure --with-png=yes
make
The error seems to be a linker error.
/usr/bin/nm: no name list
ld: warning: cannot export hidden symbol _SyncImagePixelCache from magick/.libs/magick_libMagickCore_la-cache.o
ld: warning: cannot export hidden symbol _ResetQuantumState from magick/.libs/magick_libMagickCore_la-quantum.o
Undefined symbols for architecture x86_64:
  "_png_set_check_for_invalid_index", referenced from:
      _WriteOnePNGImage in magick_libMagickCore_la-png.o
      _ReadOnePNGImage in magick_libMagickCore_la-png.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [magick/libMagickCore.la] Error 1
make: *** [all] Error 2
I have not changed any other options to configure.
How can I fix this to add libpng support?

A:
You'll need to tell ImageMagick where to locate libpng. Luckily, libpng ships with a configuration script entitled "libpng-config".
You can get the link-library option form your local libpng install with the --L_opts flag.
libpng-config --L_opts
This will return something like -L/usr/local/lib. Set ImageMagick's LDFLAGS configuration to match your libpng library.
# Use the returned value for the LDFLAGS
./configure LDFLAGS='-L/usr/local/lib'
If libpng-config returns with a message 'command not found', you'll need to ensure your libpng is installed correctly, and can be located in your shell environment. Often, this can be as simple as adding a custom path to your PATH variable.
export PATH="$PATH:/usr/local/bin"

2013年4月4日星期四

[分享] 不安装 mysql 的情况下编译安装 php 的 mysqli, mysql 扩展


下载最新的稳定版php.
$ cd php-src
$ ./configure --prefix=/Users/yongjieyang/php--enable-cli --with-libxml-dir=/usr --with-kerberos=/usr --with-zlib=/usr --enable-bcmath --with-bz2=/usr --enable-calendar --with-curl=/usr --enable-exif --enable-ftp --with-ldap=/usr --with-ldap-sasl=/usr --enable-mbstring --enable-mbregex --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mysql-sock=/var/mysql/mysql.sock --without-pear --with-iodbc=/usr --enable-shmop --with-snmp=/usr --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-xmlrpc --with-iconv-dir=/usr --with-xsl=/usr --enable-zip --with-pcre-regex=/Users/yongjieyang/local --enable-fpm
$ make
$ make test
$ make install

红色记的内容换成当前系统的正确的目录即可.
另外,没有启用 gd,因为我的机器上没有相应的库文件,懒的下载了.
--enable-fpm 开启 fastcgi.