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

相关内容

热门资讯

携程被罚没51.79亿元 7月25日,市场监管总局依法对携程集团有限公司(以下简称携程)滥用市场支配地位实施垄断行为作出行政处...
多地停运停航停课,台风“红霞”... 中央气象台7月25日06时继续发布台风橙色预警:今年第12号台风“红霞”已于今天(25日)早晨由强热...
“直-20家族”全亮相 近日,在陆军某旅直升机分队演训中,直-20与直-20T表现亮眼。075型两栖攻击舰日前也搭载直-20...
蒋万安借“725上凯道”成蓝营... 中国国民党25日将于台北凯道举办“我是人,我反毒台”集会,向民进党当局抗议中联毒油案。对此,资深媒体...
波轮式全自动洗衣机脱水时波轮转 波轮式全自动洗衣机脱水时波轮转1、衣物放置不平导致;2、排水系统发生阻塞。3、顶部的安全开关损坏;4...
洗衣机不出水怎么查原因 当洗衣机不出水时,一定是出了问题。下面就是一些可能的原因及其解决方法:1. 电源问题洗衣机不能正常工...
半自动洗衣机放不出水是什么原因... 1、检查过滤网是否堵塞。若堵塞了需要将脏东西取出来,然后再用清水将过滤网清洗干净。2、检查一下是不是...
全自动洗衣机不出水是什么原因 1、进水口的滤网被水中的杂质堵住。2、控制板上的进水继电器坏了。3、电路故障,进水电磁阀有故障或者插...
抽油烟机只通电不转怎么回事 只通电不转的故障原因和解决方法:1、电容量减小或损坏。解决方法:抽油烟机电机不转,还有嗡嗡声,一般是...
谷歌被罚9亿欧元后,特朗普称欧... 当地时间7月23日,欧盟委员会指控美国谷歌公司违反欧盟《数字市场法》,对其处以8.9亿欧元罚款。这一...