编译PHP报错:char *... configure: error: cannot compute sizeof (char *), 77

jackxiang 2010-1-24 22:06 | |
这几天编译PHP5.3.1 fast cgi的时候发现一个问题;configure的时候加上--disable-rpath就会报:
char *... configure: error: cannot compute sizeof (char *), 77

去掉这个参数就能正常通过,但是并不是所有的机器上都出这个错误;看来还是和环境有关系。

看了下文档;这个参数貌似是运行时不去某些路径搜索动态库。不是太理解。



checking sys/un.h presence... yes
checking for sys/un.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking whether zend_object_value is packed... no
checking for sqlite support... yes
checking whether to enable UTF-8 support in sqlite (default: ISO-8859-1)... no
checking for PDO includes... (cached) /usr/local/src/v1.0/software/php-5.3.1/ext
checking for lemon... no
configure: WARNING: lemon versions supported for regeneration of libsqlite parsers: 1.0 (found: none).
checking for char *... yes
checking size of char *... configure: error: cannot compute sizeof (char *), 77
See `config.log' for more details.



3.安装magickwand-0.1.8

unzip magickwand-0.1.8.zip

mv magickwand php-4.3.6/ext/

cd php-4.3.6/ext/magickwand

phpize

cd ../../

rm -rf configure

./buildconf –force

export PATH=${PATH}:/usr/local/ImageMagick/bin

#关键一步,否则编译无法通过,会有这样错误误导你:

.......... checking for ImageMagick / MagickWand in provided path... found in /usr/local/ImageMagick checking for ImageMagick / MagickWand 6.2.4 or greater with /usr/local/ImageMagick/bin/Wand-config... 6.2.6 /usr/local/ImageMagick/bin/Wand-config: line 42: Magick-config: command not found /usr/local/ImageMagick/bin/Wand-config: line 39: Magick-config: command not found ........... ........... checking size of char... configure: error: cannot compute sizeof (char), 77 See `config.log' for more details.


./configure --with-png-dir=/usr --with-gd --enable-gd-native-ttf --with-ttf --with-freetype --without-gdbm --with-gettext --with-ncurses --with-gmp --with-iconv --with-jpeg-dir=/usr  --with-png --enable-ftp --enable-sockets -with-xml --with-dom --with-zlib --enable-track-vars --with-mysql=/usr/local/mysql --with-imagick=/usr/local/ImageMagick --with-apxs2=/usr/local/apache2/bin/apxs

make

make install


补充问题:
如果MagickWand 执行./configure 时,出现checking for MagickSetImageTicksPerSecond in -lWand… NO的错误,可能是您现在安装了两个版本的ImageMagick,且默认的版本低于ImageMagick-6.3.3
可以用Magick-config –version命令查看其版本。
通常是系统安装了rpm包,解决方法是卸载掉libImageMagick包:
rpm -qa | grep 'ImageMagick'
rpm -e ImageMagick*

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/2632/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2010-1-24 22:10
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]