39.PHP5 installation, PHP7 installation

Source: Internet
Author: User
Tags bz2 soap mcrypt php compiler

PHP official website www.php.net
Current mainstream version is 5.6/7.1

First, PHP5 installation
 cd /usr/local/src/  wget http://cn2.php.net/distributions/php-5.6.30.tar.gz tar zxf php-5.6.30.tar.gz cd php-5.6.30 ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-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
    • What exactly is mysql,mysqli,mysqlnd,pdo in PHP?
      60876816

The PHP compiler configuration file specifies the path to Apache and MySQL, so you need to install Apache and MySQL first, and the initial installation will be missing a variety of library files




yum list | grep xml2yum install -y libxml2-devel.x86_64

Configure:error:Cannot find OpenSSL ' s <evp.h>

yum install -y  openssl-devel

Basically is missing the library file, the same method can solve the problem install Libxxxx-devel or xxx-devel can

    • Frequently-missing library file installation
      yum install -y libxml2-devel.x86_64yum install -y openssl-develyum install -y bzip2-develyum install -y libpng-develyum install -y freetype-develyum install -y epel-releaseyum install -y libmcrypt-devel

      After completion (remember echo $?) Check whether or not)

      make && make installcp php.ini-production  /usr/local/php/etc/php.ini   //复制配置文件
      /usr/local/php/bin/php -i | less     //查看php的配置信息

/USR/LOCAL/PHP/BIN/PHP-M//view PHP extensions, are static

Second, PHP7 installation
cd /usr/local/src/  wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2 tar jxvf php-7.1.6.tar.bz2 cd php-7.1.6 ./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php7/etc  --with-pdo-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 make && make install ls /usr/local/apache2.4/modules/libphp7.so cp php.ini-production  /usr/local/php7/etc/php.ini
ls /usr/local/apache2.4/modules/ | grep libphp  //apache需要的就是这两个扩展文件

vim /usr/local/apache2.4/conf/httpd.conf  //查看apache加载了哪些扩展,不需要的直接#注释掉即可

/usr/local/php7/bin/php -i | less  //查看php7的配置相关信息
    • The commands to view the compiler parameters for Nginx, Napache, MySQL, and PHP under Linux are as follows:
      Transfer from http://www.jzyuan.cn/?p=220
      1, nginx compilation parameters:
      /usr/local/nginx/sbin/nginx-v
      2, Apache compilation parameters:
      Cat/usr/local/apache/build/config.nice
      3, PHP compilation parameters:
      /usr/local/php/bin/php-i |grep Configure
      4. mysql Compilation parameters:
      Cat/usr/local/mysql/bin/mysqlbug|grep Configure

39.PHP5 installation, PHP7 installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.