环境运维

树莓派编译安装php5.6.15(ubuntu22.04.2 LTS)

先 安装libmcrypt、mcrypt、mhash

apt install libmcrypt-dev

apt install mcrypt 

mhash已经安装了

  1. wget http://cn2.php.net/distributions/php-5.6.15.tar.gz
  2. tar -xzvf php-5.6..tar.gz
  3. cd php-5.6.
  4. sudo ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql/ --with-zlib --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --with-curl --enable-fpm --with-mcrypt --with-gd --with-openssl --with-mhash --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc -enable-zip --enable-soap

 

./configure 遇到以下错误:

checking for cURL support... yes

checking for cURL in default path... not found

configure: error: Please reinstall the libcurl distribution -

    easy.h should be in <curl-dir>/include/curl/

 

最终解决:

sudo apt install software-properties-common

sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php

apt update

sudo apt install php5.6 php5.6-fpm php5.6-mysql php5.6-gd php5.6-mbstring php5.6-curl php5.6-soap php5.6-redis php5.6-xml php5.6-apcu php5.6-mcrypt -y

 

https://www.cnblogs.com/codeaaa/p/16534091.html