RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
树莓派3B编译安装Apache,nginx,mysql,php等遇到的问题

树莓派编译安装LANMP

  1. 简介

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

    我们提供的服务有:成都做网站、成都网站制作、微信公众号开发、网站优化、网站认证、通江ssl等。为千余家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的通江网站制作公司

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


当前标题:树莓派3B编译安装Apache,nginx,mysql,php等遇到的问题
文章路径:http://scyingshan.cn/article/gpicge.html