LAMP(2)

PHP官网www.php.net

当前主流版本为5.6/7.1

cd /usr/local/src/

wget http://cn2.php.net/distributions/php-5.6.30.tar.gz

tar zxf php-6.6.30.tar.gz

cd php-5.6.30

yum install -y openssl-devl libxml2-devel  bzip2-devel libpng-devel libjpeg-devel freetype-devel epel-release libmcrypt-devel

./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

make && make install

cp php.ini-production  /usr/local/php/etc/php.ini产品

三种mysql的库,让php支持mysql

想要的扩展模块

php就是apahce的一个扩展模块,在编译一个apache的.so 文件

查看所加载的模块

php作为apache的扩展模块

同理安装php7

wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2

tar zxf 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


LAMP(2)_第1张图片

make && make install

cp php.ini-production  /usr/local/php/etc/php.ini产品

三种mysql的库,让php支持mysql


LAMP(2)_第2张图片

想要的扩展模块

php就是apahce的一个扩展模块,在编译一个apache的.so 文件

查看所加载的模块


LAMP(2)_第3张图片

php作为apache的扩展模块


LAMP(2)_第4张图片

同理安装php7

wget http://cn2.php.net/distributions/php-7.1.6.tar.bz2

tar zxf 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


LAMP(2)_第5张图片


ls /usr/local/apache2.4/modules/libphp7.so

输出信息  /usr/local/php/bin/php -i |less


LAMP(2)_第6张图片


php中mysql,mysqli,mysqlnd,pdo到底是什么

http://blog.csdn.net/u013785951/article/details/60876816

查看编译参数

http://ask.apelearn.com/question/1295

你可能感兴趣的:(LAMP(2))