树莓派3B编译安装Apache,nginx,mysql,php等遇到的问题
admin
2023-02-23 15:40:05
0次

树莓派编译安装LANMP

  1. 简介

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

    deb https://mirrors.aliyun.com/ubuntu-ports eoan main restricted
    
    deb https://mirrors.aliyun.com/ubuntu-ports eoan-updates main restricted
    
    deb https://mirrors.aliyun.com/ubuntu-ports eoan universe
    deb https://mirrors.aliyun.com/ubuntu-ports eoan-updates universe
    
    deb https://mirrors.aliyun.com/ubuntu-ports eoan multiverse
    deb https://mirrors.aliyun.com/ubuntu-ports eoan-updates multiverse
    
    deb https://mirrors.aliyun.com/ubuntu-ports eoan-backports main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu-ports eoan-security main restricted
    deb https://mirrors.aliyun.com/ubuntu-ports eoan-security universe
    deb 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 status
make[2]: *** [htpasswd] Error 1
make[2]: Leaving directory `/usr/local/httpd-2.4.26/support'
make[1]: *** [all-recursive] Error 1
make[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解决这个问题

相关内容

热门资讯

空调连续工作多久需要停机休息 空调连续工作的时间取决于多个因素,包括空调的型号、功率、使用环境和维护情况等。一般来说,空调可以连续...
空调哪个符号是除湿的 空调除湿功能通常用一个水滴形状的符号表示。不同品牌和型号的空调遥控器可能会有所差异,但一般来说,除湿...
格力空调多长时间加一次氟利昂 1、一般情况下,空调对氟利昂的使用量是非常小的,所以在空调使用了四年左右的时候再考虑加也没问题。2、...
空调用多长时间需要加氟一次 一般情况下是五年。当出现以下这几种情况时,空调才需要加氟。1、空调的室内机和室外机各有两个接口,当接...
格调生活·C标思享荟:卡萨帝在... 9月12日的郑州龙湖金融岛,夜风轻拂,灯光璀璨。“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑...
品牌价值破千亿、高端份额持续领... 9月12日,“C标时刻共传奇——卡萨帝思享荟暨20周年品牌盛典郑州站”在郑州龙湖金融岛举办。2026...
空调主板坏了修800还是换新的 空调主板坏了是修还是换新,需要考虑多个因素,以下是一些建议:1. 维修成本:如果维修费用较低,比如 ...
空调开多久需要休息多长时间 问题:空调开多久需要休息多长时间回答:1、在使用空调的过程中,一般空调开7~8个小时左右需要休息2~...
中央空调多长时间清洗一次 1、一般空调开机前清洗一次即可,空调开机中间时段再清洗一次,空调关机时清洗一次,这样比较合理。2、空...
中央空调氟利昂多久加一次 看空调制热和制冷程度,很多人的观点认为氟利昂必须一年放一次,其实这个观点是错误的,理解上面有点偏差,...