編譯LAMP 環境之PHP

2021-09-20 16:33:05 字數 1116 閱讀 8041

版本php-5.3.27 ./configure 引數全摘自《跟阿銘一起學linux第二版》

1. [root@kaka php-5.3.27]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql  --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 --disable-ipv6

2.$ echo $?

03.$ make 

4.$ echo $?

05.$ make install

6.$ echo $?0完成

1.  ./configure前先根據引數選項,安裝依賴包:

yum install -y libxml2-devel openssl openssl-devel  bzip2 bzip2-devel  libpng libpng-devel freetype freetype-devel libjpeg libjpeg-devel

2.[root@yaho php-5.3.27]# yum install -y libtool-ltdl libtool-ltdl-devel #解決找不到lltdl檔案問題

3.安裝加密模組:libmcrypt

wget 

$ tar zxf libmcrypt

$ cd libmcrypt

$ ./configure

提示需要缺少c++庫

$ yum install -ygcc-c++

$ make &&make install

$ cd ..                               #回到php目錄

lamp環境只編譯安裝php

linux上yum安裝apache和mysql的源更新都較快,但php版本往往比較低。所以往往有需求yum安裝apache和mysql,然後編譯安裝php。這個思路就在於不使用yum安裝php,需要手動指定apxs的路徑。補充知識 apxs是乙個為apache http伺服器編譯和安裝擴充套件模組的...

PHP開發之lamp環境

我用的是centos7,用yum源安裝apache yum install apache y 最後的 y是預設同意安裝的意思 用yum源安裝php yum install php y 用yum源安裝mariadb yum install mariadb y 最後啟動apache啟動mariabd 以...

手動編譯安裝lamp之php

馬哥教育講課文件 三 編譯安裝php 5.4.8 1 解決依賴關係 請配置好yum源 可以是本地系統光碟 後執行如下命令 yum y groupinstall x software development libmcrypt 2.5.7 5.el5.i386.rpm libmcrypt devel ...