树莓派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解决这个问题

相关内容

热门资讯

伊朗最高领袖军事顾问:美国必须... 当地时间5月6日,伊朗最高领袖军事顾问穆赫辛·雷扎伊在接受采访时表示,伊朗不允许美国在不付出代价的情...
瑞士确诊、法国密接、西班牙待命... 综合法媒报道,国际探险邮轮“洪迪厄斯”号上的汉坦病毒事件,正从南美航程延伸至欧洲语境。最新进展显示,...
AMD锐龙X3D快到把游戏跑崩... 快科技5月6日消息,在Apex英雄最新Overclocked补丁中,修复了一个颇为尴尬的问题:AMD...
重磅|第十九届智慧城市大会将于... 2026年7月16日-18日,第十九届智慧城市大会将在天津社会山国际会议中心举办。本届大会由中国服务...
奥巴马暗批特朗普:不应将司法与... 美国前总统奥巴马近日在接受采访时,借列举总统权力被滥用的多个例子,含蓄批评总统特朗普,但全程未直接点...
三星宣布:在中国大陆市场停止销... 【大河财立方消息】5月6日,三星(中国)投资有限公司发布通知称,为应对急剧变化的市场环境,经慎重研究...
郑州商转公“直还”扩容!80家... 【大河财立方消息】5月6日,郑州住房公积金管理中心公告,13家银行已与郑州住房公积金管理中心签订《商...
男子花数十万买回犀牛角、熊胆,... 王绍斌至今想不通,自己是个三十多年的生意人,怎么会在老挝一下子刷出去六位数,买回来两片犀牛角、半块熊...
电动汽车充电量创历史新高!河南... 【大河财立方 记者 张克瑶】5月6日,大河财立方记者从河南省住房和城乡建设厅获悉,2026年“五一”...
为快乐买单,情绪经济如何“点燃... 【大河财立方 记者 王宁宁 文图】从强势出圈的丑萌潮玩LABUBU,到年轻人的解压新宠“网红”拼豆;...