64bit centos 6.5 編譯安裝 LAMP 環境

來源:互聯網
上載者:User

標籤:64bit centos 6.5 編譯安裝 lamp 環境

  1. MySQL5.5.40 編譯安裝

    請參考 MySQL5.5.40編譯安裝

  2. Apache 2.4.10 編譯安裝

    請參考 Apache 2.4.10 編譯安裝

  3. PHP 5.4.33 編譯安裝


下面我們開始編譯安裝PHP5.4.33

首先下載源碼包到使用者目錄下, 下載PHP5.4.33

也可以使用命令列下載:

[[email protected] ~]# wget http://kr1.php.net/get/php-5.4.33.tar.bz2/from/this/mirror

然後解壓源碼

[[email protected] ~]# tar -xvf php-5.4.33.tar.bz2 -C /usr/local/src/

因為我們編譯php需要的一些RPM包預設的yum源中沒有, 我們需要安裝epel yum源

安裝epel yum源:

[[email protected] ~]# wget [[email protected] ~]# rpm -ivh epel-release-6-8.noarch.rpm

epel yum源安裝好之後, 我們來安裝php需要的一些rpm包

[[email protected] ~]# yum -y install libmcrypt libmcrypt-devel bzip2-devel libxml2 libxml2-devel

然後進入php源碼解壓好的目錄

[[email protected] ~]# cd /usr/local/src/php-5.4.33/[[email protected] php-5.4.33]# ./configure --prefix=/usr/local/php-5.4.33 --with-mysql=/usr/local/mysql-5.5.40/ \ #MySQL安裝目錄--with-openssl=/usr/local/openssl-1.0.1i/ \ #OpenSSL安裝目錄--with-mysqli=/usr/local/mysql-5.5.40/bin/mysql_config --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir --with-apxs2=/usr/local/httpd24/bin/apxs \ #指向Apache安裝目錄下/bin/apxs--with-mcrypt --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-xml --enable-sockets --enable-maintainer-zts --enable-mbstring

開始配置,ok之後

[[email protected] php-5.4.33]# make && make install



編輯apache設定檔httpd.conf, 讓apache支援php

vim /etc/httpd24/httpd.conf

添加如下兩行

AddType application/x-httpd-php .phpAddType application/x-httpd-php-source .phps

定位至DirectoryIndex index.html

修改為

DirectoryIndex index.php index.html

然後測試下

在網頁檔案中

輸入 

<?php

    phpinfo();

?>

重啟下web伺服器

service httpd restart

開啟你的網頁看看, 是否正常顯示










本文出自 “帝國金菜園子” 部落格,請務必保留此出處http://diguojin.blog.51cto.com/5034509/1562633

64bit centos 6.5 編譯安裝 LAMP 環境

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.