linux下apache+php搭建配置記錄

來源:互聯網
上載者:User

linux下apache+php搭建配置記錄 第1章  環境說明1.1 系統說明Centos 6.2 (迷你安裝)1.2 軟體說明httpd-2.4.2.tar.gzapr-util-1.4.1.tar.gzapr-1.4.6.tar.gzpcre-8.13.tar.gzphp-5.4.3.tar.bz2libmcrypt-2.5.8.tar.gzmhash-0.9.9.9.tar.gz第2章  Apache搭建說明2.1 安裝依賴包yum install make openldap-devel ntp vim-enhanced gcc gcc-c++ gcc-g77 flex bison autoconf bzip2-devel ncurses-devel openssl-devel libtool*  zlib-devel libxml2-devel libjpeg-devel libpng-devel libtiff-devel fontconfig-devel freetype-devel libXpm-devel gettext-devel curl-devel curl pam-devel  openldap-devel e2fsprogs-devel krb5-devel libidn libidn-devel -y2.2 安裝aprtar -zxvf apr-1.4.2.tar.gz cd apr-1.4.2.tar.gz ./configure  --prefix=/usr/local/aprmake  && make install2.3 安裝apr-utiltar -zxvf apr-util-1.3.10.tar.gzcd apr-util-1.3.10.tar.gz ./configure \--prefix=/usr/local/apr-util \--with-apr=/usr/local/apr make && make install2.4 安裝pcretar -zxvf pcre-8.10.tar.gzcd pcre-8.10./configure --prefix=/usr/local/pcremake && make install2.5 安裝apache./configure \--prefix=/usr/local/apache \--with-apr-util=/usr/local/apr-util/ \--with-pcre=/usr/local/pcre/ \--with-apr=/usr/local/apr/make && make install2.6 設定檔說明/usr/local/apache/conf/httpd.confDocumentRoot "/usr/local/apache/htdocs"修改此條可設定項目運行目錄。開機檔案/usr/local/apache/bin/apachectl第3章  Php搭建說明3.1 安裝libmcrypttar xvf libmcrypt-2.5.8.tar.gz./configuremake && make install3.2 安裝mhashtar xvf mhash-0.9.9.9.tar.gzcd mhash-0.9.9.9./configure make && make install3.3 安裝php./configure --prefix=/usr/local/php \--with-apxs2=/usr/local/apache/bin/apxs \--with-config-file-path=/usr/local/php/etc make && make install cp php.ini-production /usr/local/php/etc/php.ini3.4 錯誤提示修改說明configure: error: Cannot find ldap libraries in /usr/libln -s /usr/lib64/libldap* /usr/lib/configure: error: libjpeg.(a|so) not found.ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.soconfigure: error: libpng.(a|so) not found.ln -s /usr/lib64/libpng.so /usr/lib/第4章  修改配置並測試4.1 修改apache設定檔支援php修改DirectoryIndex index.html 為DirectoryIndex index.html index.php並添加AddType application/x-httpd-php .php4.2 測試php支援建立測試php頁面test.php,並存放在網站主目錄下,<?phpphpinfo();?>重啟apache服務後,訪問http://ip/test.php看到網站,則說明php搭建完成; 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.