2

我只是想用 enable-dmalloc 构建 PHP7

环境:

the version of PHP is 7.1.0RC5
debian 8
gcc6.2
dmalloc 5.5.2

使用了这个命令:

./configure --prefix=/usr/local/php/70 --with-config-file-path=/usr/local/lib/php/70/etc --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-apxs2=/usr/local/httpd/2.4/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pgsql=/usr/local/PostgreSQL/9.5 --with-pdo-mysql=/usr/local/mysql --with-pdo-pgsql=/usr/local/PostgreSQL/ --enable-ftp --enable-zip --with-bz2 --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir -with-zlib --enable-bcmath --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd  --with-freetype-dir --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-exif --enable-debug --enable-phpdbg --enable-phpdbg-webhelper --enable-phpdbg-debug --enable-dtrace --enable-dmalloc --with-openssl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-pear --enable-maintainer-zts

make

但它失败并出现错误消息:

/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before string constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;

/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;

In file included from /usr/local/src/php-7.1.0RC5/main/php.h:26:0,
             from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdhelpers.h:5,
             from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdft.c:13:
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before ‘(’ token extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;

/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;

/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;

/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;

/usr/include/malloc.h:41:51: error: expected declaration specifiers or ‘...’ before string constant extern void *calloc (size_t __nmemb, size_t __size)

/usr/include/malloc.h:49:49: error: expected declaration specifiers or ‘...’ before string constant extern void *realloc (void *__ptr, size_t __size)

/usr/include/malloc.h:53:30: error: expected declaration specifiers or ‘...’ before string constant extern void free (void *__ptr) __THROW;

/usr/include/malloc.h:59:57: error: expected declaration specifiers or ‘...’ before string constant extern void *memalign (size_t __alignment, size_t __size)

/usr/include/malloc.h:63:35: error: expected declaration specifiers or ‘...’ before string constant extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;

Makefile:1028: recipe for target 'ext/gd/libgd/gdft.lo' failed

make: *** [ext/gd/libgd/gdft.lo] Error 1

我在 gdft.c、gdhelper.h 和 php.h 中看到了源代码,找到了这一行:

#ifdef HAVE_DMALLOC
#include <dmalloc.h>
#endif

可能是 dmalloc 导致了这个错误,但我不知道为什么错误 msg show malloc.h,我检查了一下/usr/include,它有malloc.h两个dmalloc.h文件

我安装了包 libdmalloc 和 libdmalloc-dev 并尝试使用源代码重新安装 dmalloc 但它没有帮助

这些是什么原因造成的,我该如何处理?

4

0 回答 0