[Topic DIscussion] 求教 Deepin 20.4源码编译PHP8.1.3 出错
Tofloor
poster avatar
深圳市耀影科技有限公司
deepin
2022-03-14 18:11
Author

-求教 Deepin 20.4源码编译PHP8.1.3 出错

步骤如下:

1../buildconf

./configure
--prefix=/opt/apps/php
--enable-re2c-cgoto
--enable-fpm
--with-fpm-systemd
--with-fpm-acl
--with-fpm-apparmor
--enable-litespeed
--enable-phpdbg
--with-valgrind
--enable-gcov
--enable-zts
--enable-sigchild
--enable-libgcc
--enable-dmalloc
--enable-dtrace
--enable-fd-setsize=1024
--enable-werror
--enable-address-sanitizer
--enable-undefined-sanitizer
--with-openssl
--with-kerberos
--with-system-ciphers
--with-external-pcre
--with-zlib
--enable-bcmath
--enable-calendar
--with-curl
--enable-dba
--disable-inifile
--disable-flatfile
--with-enchant
--enable-exif
--with-ffi
--enable-ftp
--with-openssl-dir
--enable-gd
--with-external-gd
--with-avif
--with-webp
--with-jpeg
--with-xpm
--with-freetype
--enable-gd-jis-conv
--with-mhash
--with-kerberos
--with-imap-ssl
--enable-intl
--enable-mbstring
--with-iodbc
--with-unixODBC
--enable-pcntl
--without-pdo-sqlite
--with-libedit
--enable-shmop
--enable-soap
--enable-sockets
--with-sodium
--with-password-argon2
--enable-sysvmsg
--enable-sysvsem
--enable-sysvshm
--with-xsl
--enable-zend-test
--with-zip
--enable-mysqlnd
--enable-shared=PKGS
--enable-static=PKGS
--enable-fast-install=PKGS \

截图_选择区域_20220314100928.png

3.make -j4

报错

/home/yaoying/Desktop/php-8.1.3/php-8.1.3/ext/bcmath/libbcmath/src/add.c -o ext/bcmath/libbcmath/src/add.lo  -MMD -MF ext/bcmath/libbcmath/src/add.dep -MT ext/bcmath/libbcmath/src/add.lo
/usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:51: error: expected declaration specifiers or ‘...’ before string constant
extern int posix_memalign (void **, size_t, size_t);
^
/usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:51: error: expected declaration specifiers or ‘...’ before numeric constant
extern int posix_memalign (void **, size_t, size_t);
^
In file included from /home/yaoying/Desktop/php-8.1.3/php-8.1.3/main/php.h:22,
from /home/yaoying/Desktop/php-8.1.3/php-8.1.3/ext/bcmath/libbcmath/src/bcmath.h:58,
from /home/yaoying/Desktop/php-8.1.3/php-8.1.3/ext/bcmath/libbcmath/src/add.c:37:
/usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern int posix_memalign (void **, size_t, size_t);
^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern int posix_memalign (void **, size_t, size_t);
^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected declaration specifiers or ‘...’ before numeric constant
extern int posix_memalign (void **, size_t, size_t);
^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected declaration specifiers or ‘...’ before ‘(’ token
extern int posix_memalign (void **, size_t, size_t);
^~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/8/include/mm_malloc.h:32:12: error: expected declaration specifiers or ‘...’ before numeric constant
extern int posix_memalign (void **, size_t, size_t);
^~~~~~~~~~~~~~
make: *** [Makefile:950:ext/bcmath/libbcmath/src/add.lo] 错误 1

截图_选择区域_20220314101126.png

主要是配置, 好像问题出现在这个上面

--enable-dmalloc

sudo mkdir /opt/src  #创建目录
cd /opt/src  #源码保存目录
wget https://dmalloc.com/releases/dmalloc-5.6.5.tgz  # 下载源码
tar -xvf dmalloc-5.6.5.tgz  # 解压
cd dmalloc-5.6.5
sudo ./configure # 运行configure脚本
sudo make  # 构建编译
sudo make install # 安装

通过以上安装之后,解决报错

  • 参考 DEBIAN 官方的源码构建依赖(系统已经自带了这个库)
    • https://packages.debian.org/source/buster/dmalloc
  • 这里是一个没有解决的同类
    • https://oomake.com/question/12298579
Reply Favorite View the author
All Replies
lcw0268
deepin
2022-03-14 20:57
#1
It has been deleted!
深圳市耀影科技有限公司
deepin
2022-03-14 21:35
#2
lcw0268 It has been deleted!

😢 -

deb https://packages.sury.org/php/ apricot main

这里有每一个版本,但是我需要源码编译安装啊。。。。。。。。

Reply View the author
lcw0268
deepin
2022-03-14 22:04
#3
It has been deleted!
深圳市耀影科技有限公司
deepin
2022-03-14 22:59
#4
lcw0268 It has been deleted!

主要是配置, 好像问题出现在这个上面

--enable-dmalloc

sudo mkdir /opt/src  #创建目录
cd /opt/src  #源码保存目录
wget https://dmalloc.com/releases/dmalloc-5.6.5.tgz  # 下载源码
tar -xvf dmalloc-5.6.5.tgz  # 解压
cd dmalloc-5.6.5
sudo ./configure # 运行configure脚本
sudo make  # 构建编译
sudo make install # 安装

通过以上安装之后,解决报错

  • 参考 DEBIAN 官方的源码构建依赖(系统已经自带了这个库)
    • https://packages.debian.org/source/buster/dmalloc
  • 这里是一个没有解决的同类
    • https://oomake.com/question/12298579
Reply View the author
安全第一
deepin
2023-01-30 06:38
#5
深圳市耀影科技有限公司

😢 -

deb https://packages.sury.org/php/ apricot main

这里有每一个版本,但是我需要源码编译安装啊。。。。。。。。

你给的这个网址,apt update报错,仓库 没有 Release 文件

Reply View the author