Linux 软件安装 ARM64编译安装PHP教程

ARM64编译安装PHP教程

安装相关依赖

包括gcc gcc-c++ openssl openssl-devel tar libxml2-devel openssl openssl-devel curl curl-devel libjpeg libjpeg-devel freetype freetype-devel libpng libpng-devel libxslt libxslt-devel pcre pcre-devel bzip2 bzip2-devel sqlite-devel oniguruma oniguruma-devel openldap openldap-devel libicu-devel libicu

下载php安装包

wget https://www.php.net/distributions/php-7.4.30.tar.gz

进行编译

[root@message php-7.4.30]  cp -frp /usr/lib64/libldap* /usr/lib/
#解压安装oniguruma
root@message oniguruma]  ./configure --bindir=/usr/sbin/ \
            --sbindir=/usr/sbin/ \
            --libexecdir=/usr/libexec \
            --sysconfdir=/etc/ \
            --localstatedir=/var \
            --libdir=/usr/lib64/  \
            --includedir=/usr/include/ \
            --datarootdir=/usr/share \
            --infodir=/usr/share/info \
            --localedir=/usr/share/locale \
            --mandir
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
arm-linux下交叉编译Apache和PHP的步骤如下: 1. 首先安装交叉编译工具链,例如arm-linux-gcc等工具链。 2. 下载Apache和PHP源码,解压缩到指定目录。 3. 进入Apache源码目录,执行configure命令,指定交叉编译工具链的路径和其他相关参数,例如: ``` ./configure --host=arm-linux --prefix=/usr/local/apache2 --enable-so --disable-ssl --disable-proxy --disable-authn-file --disable-autoindex --disable-dir --disable-env --disable-reqtimeout --disable-userdir --disable-setenvif --disable-status --disable-cgi ``` 其中,--host参数指定目标平台的架构,--prefix参数指定安装目录,--enable-so参数指定支持动态链接库等。 4. 执行make命令编译Apache,然后执行make install命令安装Apache到指定目录。 5. 进入PHP源码目录,执行configure命令,指定交叉编译工具链的路径和其他相关参数,例如: ``` ./configure --host=arm-linux --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --disable-debug --enable-mbstring --enable-zip --enable-bcmath --enable-sockets --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-curl --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --without-pear ``` 其中,--with-apxs2参数指定Apache的apxs路径,--with-curl参数指定支持curl库,--with-gd参数指定支持gd库等。 6. 执行make命令编译PHP,然后执行make install命令安装PHP到指定目录。 7. 在Apache的配置文件httpd.conf中添加PHP的模块加载语句,例如: ``` LoadModule php7_module modules/libphp7.so AddType application/x-httpd-php .php ``` 其中,libphp7.so是PHP编译生成的动态链接库。 8. 重启Apache服务器,测试PHP是否正常工作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值