千家信息网

树莓派3B编译安装Apache,nginx,mysql,php等遇到的问题

发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,树莓派编译安装LANMP简介我这里的树莓派是3B版本,CPU4核,内存1G,系统我用的是Ubuntu的19.10版。镜像采用阿里的镜像,镜像源如下:deb https://mirrors.aliyun
千家信息网最后更新 2026年11月02日树莓派3B编译安装Apache,nginx,mysql,php等遇到的问题

树莓派编译安装LANMP

  1. 简介

    我这里的树莓派是3B版本,CPU4核,内存1G,系统我用的是Ubuntu的19.10版。镜像采用阿里的镜像,镜像源如下:

    deb https://mirrors.aliyun.com/ubuntu-ports eoan main restricteddeb https://mirrors.aliyun.com/ubuntu-ports eoan-updates main restricteddeb https://mirrors.aliyun.com/ubuntu-ports eoan universedeb https://mirrors.aliyun.com/ubuntu-ports eoan-updates universedeb https://mirrors.aliyun.com/ubuntu-ports eoan multiversedeb https://mirrors.aliyun.com/ubuntu-ports eoan-updates multiversedeb https://mirrors.aliyun.com/ubuntu-ports eoan-backports main restricted universe multiversedeb https://mirrors.aliyun.com/ubuntu-ports eoan-security main restricteddeb https://mirrors.aliyun.com/ubuntu-ports eoan-security universedeb https://mirrors.aliyun.com/ubuntu-ports eoan-security multiverse

------------ 问题1
编译安装apr-util-1.5版本时出现如下错误
libtool: error: 'crypto/crypt_blowfish.lo' is not a valid libtool object
这种情况有可能是前面编译时有缓存,用make clean清除一下再次编译安装

---------------问题2

HTTP编译时出现如下错误可能是由于apr-util版本太高,换成1.5的版本试试/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetEntityDeclHandler'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserCreate'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetCharacterDataHandler'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ParserFree'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetUserData'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_StopParser'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_Parse'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_ErrorString'/usr/local/apr-util/lib/libaprutil-1.so: undefined reference to `XML_SetElementHandler'collect2: error: ld returned 1 exit statusmake[2]: *** [htpasswd] Error 1make[2]: Leaving directory `/usr/local/httpd-2.4.26/support'make[1]: *** [all-recursive] Error 1make[1]: Leaving directory `/usr/local/httpd-2.4.26/support'make: *** [all-recursive] Error 1

---------问题3
NGINX编译时出现问题
src/http/ngx_http_script.c:698:18: error: cast between incompatible function types from 'size_t ()(ngx_http_script_engine_t )'
{aka 'long unsigned int ()(struct )'} to 'void ()(ngx_http_script_engine_t )' {aka 'void ()(struct )'}
[-Werror=cast-function-type]
这个错误把MakeFile文件中的werror这个删除调,然后清理编译缓存,make clean 重新编译

---------------问题4
在编译安装mariadb10.1.43时出现:cc: fatal error: Killed signal terminated program cc1
这种情况应该是内存不足造成的,我从网上看到的方法是使用交换内存,但是由于树莓派是直接用TF卡安装的,开始没有设置swap,后来我设置了还是报这个错误----内部编译错误
后来我的解决方法不安装Mariadb数据库,改用MySQL5.6,结果是编译成功了的。

--------------问题5
编译PHP时出现:
make: *** [Makefile:584: ext/openssl/openssl.lo] Error 1
error: storage size of 'cipher_ctx' isn't known
4848 | EVP_CIPHER_CTX cipher_ctx;
这种情况是OpenSSL最新版本接口调用变化所致,更换PHP为较新版本试一下或者使用OpenSSL较旧的版本


PHP编译安装配置:

./configure --prefix=/usr/local/php5.3 --enable-mbstring --enable-xml --enable-fpm --enable-sockets --with-mysql=mysqlnd \--with-pdo-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib \--with-libxml-dir=/usr --with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 \--with-mysql=/usr/local/mysql --enable-pcntl --enable-dba --with-gd --enable-gd-native-ttf --enable-gd-jis-conv --enable-ftp \--enable-embedded-mysqli --with-webp-dir --enable-debug --enable-bcmath --with-ldap --with-gettext

1

NOTE树莓派编译安装时出现:onfigure: error: can not guess host type; you must specify one,这种情况除了要加--build=arm-linux,还有加上--host=localhost
Php7.1.33版本要求OpenSSL必须大于1.0.1版本:--with-openssl[=DIR] Include OpenSSL support (requires OpenSSL >= 0.9.6)
要求zlib大于1.2.0.4版本 --with-zlib[=DIR] Include ZLIB support (requires zlib >= 1.2.0.4)
2
编译时出现:freetype-config not found错误时,应该是libfreetype-dev版本比较高,在Ubuntu19.10上是版本6.可以下载2.8.1解决这个问题

编译 版本 问题 时出 错误 树莓 情况 内存 镜像 方法 缓存 成功 再次 接口 数据 数据库 文件 简介 系统 结果 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网科技公司的优势 科技企业和互联网企业 互联网扶贫科技 唐信互联网科技 大连 狮子座互联网科技培训 天扬科技互联网广告 互联网科技公司的市场部门 卫星互联网科技股票 农村开互联网科技讲堂 福州新华互联网科技学校 知乎 央行互联网金融科技公司 互联网公司科技股 花神(南京)互联网科技有限公司 青岛科技大学互联网大赛研究生 和信科技工业互联网 广州市恰铎互联网科技有限公司 无锡工业互联网科技有限公司 四川互联网展示科技馆设计 互联网相关科技技术 互联网与数字科技关系 中国互联网科技工作委员会毛军 深圳互联网络科技有限公司 互联网金融科技平台 互联网科技logo设计 沃里互联网科技 上海亿帐通互联网科技 厦门比较好的科技互联网公司 南平创想时代互联网科技有限公司 搜狐科技互联网 广西泛欧互联网科技有限公司
0