Linux 下源码搭建LAP环境

yum install gcc gcc+ libxml2-devel //编译支持

yum  install epel-release  //扩展包更新包  可不执行

yum  update //更新yum源  可不执行

apache 2.4.29安装

下载地址http://mirrors.hust.edu.cn/apache//httpd/httpd-2.4.29.tar.gz

CC="pgcc" CFLAGS="-O2" ./configure --prefix=/usr/local/httpd --enable-ldap=shared --enable-lua=shared

make

make install

php安装成功以后配置

httpd.conf配置

添加 AddType application/x-httpd-php .php 56行左右

DirectoryIndex index.html 改成 DirectoryIndex index.html index.php

添加php扩展

LoadModule php7_module modules/libphp7.so

php7.2.1安装 -total

//php依赖环境

yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel

php7.2.1安装

tar -zxvf ** --解压php源文件包

./configure --prefix=/usr/local/php7 --with-config-file-path=/usr/local/php7 --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-soap --with-apxs2=/usr/local/httpd/bin/apxs --with-xmlrpc --with-openssl --with-mhash --with-pcre-regex --with-sqlite3 --with-zlib --enable-bcmath --with-iconv --with-bz2 --enable-calendar --with-curl --with-cdb --enable-dom --enable-exif --enable-fileinfo --enable-filter --with-pcre-dir --enable-ftp --with-gd --with-openssl-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-freetype-dir --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear --enable-opcache

make

make install

配置文件

cp php.ini-production /usr/local/php7/php.ini

或者

cp php.ini-development /usr/local/php7/lib/php.ini

posted @ 2018-02-03 10:05  刘小伟  阅读(260)  评论(0编辑  收藏  举报