Install php5 tutorial on linux

php installation steps

 

  • Go to the src directory cd /usr/local/src
  • download php wget http://cn2.php.net/distributions/php-5.6.30.tar.bz2
  • Unzip the php compressed file tar -jxvf php-5.6.30.tar.bz2
  • Enter the directory cd php-5.6.30
  • Configure php related parameters
    [root@glinux-01 php-5.6.30]# ./configure  --prefix=/usr/lcoal/php --with-
    apxs2=/usr/local/apache2.4.33/bin/apxs --with-config-file-path=/usr/local/php/etc 
    --with-mysql=/usr/local/mysql --with-dpo-mysql=/usr/local/mysql --with-
    mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir 
    --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 
    --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf 
    --enable-mbstring --enable-sockets --enable-exif

--with-apxs2 apache automatic configuration tool

--with-config-file-path specifies the path where the php configuration file is located

--with-mysql=/usr/local/mysql The old version uses this (php7 does not use this)

--with-mysqli Use this for newer versions

After running, an error is reported, looking for the libxml2 library

Missing openssl

missing bzip2

missing jpeglib

missing png

missing freetype

Missing mcrypt

Install yum install -y libxml2-devel

install yum install -y openssl-devel

Install yum install -y bzip2-devel

install yum install -y libjpeg-devel

install yum install -y libpng-devel

Install yum install -y freetype-devel

Install yum install -y epel-release (libmcrypt library is in it)

install yum install -y libmcrypt-devel

  • make  & make install

 

make: *** [libphp5.la] Error 1

Workaround:
yum -y install libtool libtool-ltdl-devel

Make clean first, then restart

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324399687&siteId=291194637