LANMP架構安裝支持庫和常用編譯參數

Nginx編譯安裝參數

./configure --prefix=/usr/local/nginx --group=nginx --user=nginx --with-http_stub_status_module --with-http_ssl_module




MySQL5.6編譯安裝參數:


cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/usr/local/mysql/data/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8,gbk -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306


編譯器和部分支持庫的安裝

yum  install –y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* cmake





PHP支持庫的安裝:

yum install -y zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel 



PHP-5.6編譯安裝參數:(針對Apache)


./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache-2.2.31/bin/apxs --with-mysql=/usr/local/mysql --with-xmlrpc --with-openssl --with-zlib --with-freetype-dir --with-zlib --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/iconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --enable-curl --enable-xsl --enable-ftp --with-libxml-dir


  修改Apache配置文件,增加對PHP的支持。

    AddType application/x-httpd-php .php .phtml .inc .php3

    AddType application/x-httpd-source .phps



PHP-5.6編譯安裝參數:(針對Nginx)


檢查支持庫

Step1:

    yum install -y zlib libxml libjpeg freetype libpng gd curl libiconv zlib-devel libxml2-devel libjpeg-devel freetype-devel libpng-devel gd-devel curl-devel

Step2:

    tar xf libiconv.tar.gz

    ./configure --prefix=/usr/local/libiconv

    make && make install

Step3:

    tar xf libmcrypt.tar.gz

    ./configure 

    make && make install




./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-xmlrpc --with-openssl --with-zlib --with-freetype-dir --with-zlib --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/iconv --enable-short-tags --enable-sockets  --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --enable-ftp --with-libxml-dir --enable-fpm  --with-mhash --enable-pcntl  --with-fpm-user=nginx --with-fpm-group=nginx --with-libxml --enable-bcmath --disable-rpath --enable-safe-mode --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-zip --with-mcrypt=/usr/local/libmcrypt --with-libdir=lib64



./configure --prefix=/usr/local/php --enable-fpm --enable-pcntl --enable-mysqlnd --enable-opcache --enable-sockets --enable-sysvmsg --enable-sysvsem  --enable-sysvshm --enable-shmop --enable-zip --enable-ftp --enable-soap --enable-xml --enable-mbstring --disable-rpath --disable-debug --disable-fileinfo --with-mysql=/usr/local/mysql --with-pdo-mysql --with-pcre-regex --with-iconv --with-zlib --with-mcrypt=/usr/local/libmcrypt --with-gd --with-openssl --with-mhash --with-xmlrpc --with-curl --with-imap-ssl --with-fpm-user=nginx --with-fpm-group=nginx





configure: WARNING: unrecognized options: --enable-zend-multibyte, --enable-curl, --enable-xsl, --with-libxml, --enable-safe-mode, --with-curlwrappers





老男孩版本

./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbreget --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags --enable-zend-multibyte --enable-static --with-xsl --with-fpm-user=nginx --with-fpm-group=nginx --enable-ftp



ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/



 --with-zlib-dir=DIR  --with-pcre-dir --with-libzip=DIR    

 --with-zlib-dir=DIR --with-pcre-dir  --with-libzip=DIR 



 \cp -frp /usr/lib64/libltdl.so* /usr/lib/


\cp -frp /usr/lib64/libXpm.so* /usr/lib/



趙榮濤終極版本(Nginx)


./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql --with-gd --with-png-dir --with-jpeg-dir --with-freetype-dir --with-xpm-dir --with-zlib-dir --with-iconv=/usr/local/iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --enable-ctype --with-fpm-user=nginx --with-fpm-group=nginx 



--with-apxs2=/usr/local/apache2/bin/apxs 




趙X版本修改版(針對apache)

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysql-sock --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-fpm --with-ncurses --enable-soap --with-libxml-dir --with-XMLrpc --with-openssl --with-mcrypt --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-native-ttf --enable-gd-jis-conv --with-gettext --with-gmp --with-mhash --enable-json --enable-mbstring --disable-mbregex --disable-mbregex-backtrack --with-libmbfl --with-onig --enable-pdo --with-pdo-mysql --with-zlib-dir --with-pdo-sqlite --with-readline --enable-session --enable-shmop --enable-simplexml --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-libxml-dir  --with-xsl --enable-zip --enable-mysqlnd-compression-support --with-pear


實測成功的192.168.0.71編譯安裝參數(Apache)

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache-2.2.31/bin/apxs --with-mysql=/usr/local/mysql --with-xmlrpc --with-openssl --with-freetype-dir --with-zlib --with-gd --with-jpeg-dir --with-png-dir --with-iconv=/usr/local/iconv --enable-short-tags --enable-sockets --enable-zend-multibyte --enable-soap --enable-mbstring --enable-static --enable-gd-native-ttf --enable-curl --enable-xsl --enable-ftp --with-libxml-dir 




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章