1. 程式人生 > >Linux 下源碼搭建LAP環境

Linux 下源碼搭建LAP環境

tar bre ror apxs rod 源碼 源文件 disable mod

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

Linux 下源碼搭建LAP環境