1 / 5

PHP5 程式設計

PHP5 程式設計. 第一章 APACHE 2 與 PHP5 的安裝 1-1 安裝 APACHE 2 與 PHP5 1-2 將 Linux 加強安全的選項取消. 1-1 安裝 APACHE 2 與 PHP5. 我們可以安裝 Apache2 與 PHP5 。安裝 Apache2 ,我們從 www.apache.org 下載網站伺服器 Apache2 的原始檔軟體。我們使用 tar 指令將它解開。 # gzip -d httpd-2.0.53.tar.gz # tar xvf httpd-2.0.53.tar

page
Télécharger la présentation

PHP5 程式設計

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PHP5程式設計 第一章 APACHE 2與PHP5的安裝 1-1 安裝APACHE 2與PHP5 1-2 將Linux加強安全的選項取消

  2. 1-1 安裝APACHE 2與PHP5 • 我們可以安裝Apache2與PHP5。安裝Apache2,我們從www.apache.org下載網站伺服器Apache2的原始檔軟體。我們使用tar指令將它解開。 • # gzip -d httpd-2.0.53.tar.gz • # tar xvf httpd-2.0.53.tar • # tar -zxvf php-5.0.3.tar.gz • 我們使用./configure來組態網站伺服器Apache2,並且將它安裝到/usr/local/目錄下,我們啟動模組—enable-module=so。 • # cd httpd-2.0.53 • #./configure --prefix=/usr/local/ --enable-module=so • 我們編譯Apache2並且將它安裝。 • #make • #make install • 在Linux上與Apache2安裝PHP5。我們到www.php.net下載PHP5的原始檔軟體。我們使用tar來將PHP5的原始檔解壓縮。我們可以使用./configure –help,來觀看組態檔的情況。 • # tar xzvf php-5.0.3.tar.gz • 我們組態PHP5的原始檔,並且啟用Apache2的動態模組,在這裏我們只作PHP5和Apache2的應用。 • # ./configure --with-apxs2=/usr/local/apache/bin/apxs • 我們使用make來編譯PHP5。 • #make

  3. 我們使用make install來將已經編譯好的PHP5安裝。 • #make install • 設定PHP組態檔,我們將PHP5的組態檔php.ini放到/usr/local/lib的目錄下。 • #cp php.ini-dist /usr/local/lib/php.ini • 編輯Apache2的模組httpd.conf來讓它載入libphp5.so的PHP5的模組。這是在PHP5中所設定的。 • LoadModule php5_module libexec/libphp5.so • 這是在PHP4中所設定的。 • LoadModule php4_module libexec/libphp4.so • 為了讓Apache能夠解析PHP,我們設定 • AddType application/x-httpd-php .php .phtml • AddType application/x-httpd-php-source .phps • 在安裝和組態好Apache2和PHP5後,我們要重新啟動網站伺服器Apache。我們在Apache2安裝的目錄下/usr/local/apache執行apachectl start。 • #/usr/local/apache/bin/apachectl start • 如果要停止網站伺服器Apache2,我們使用apachectl stop來停止。 • #/usr/local/apache/bin/apachectl stop • 如果要重新啟動網站伺服器Apache2,我們使用apachectl restart來重新啟動。 • #/usr/local/apache/bin/apachectl restart • 這樣就結合了PHP5與apache2了。

  4. 1-2將Linux加強安全的選項取消 • 在架設網站前,我們還有一項是非常重要的關念,如果我們是使用Fedora 最新版來架設網站,則因為在安裝作業系統的時後會安裝SELinux,這是Security Enforcement Linux加強Linux安全的檔案系統,因此在Xoops安裝時,會發生問題,而無法安裝。因此我們在安裝前,要將SELinux設定為不啟動disable。我們編輯SELinux的組態檔/etc/selinux/config,並且將SELINUX的選項設定為disabled。我們也可以在核心命令模式下設定selinux=0。 • #vi /etc/selinux/config

  5. 這是安裝Fedora作業系統的時後設定SELinux(Linux加強安全性)。這是安裝Fedora作業系統的時後設定SELinux(Linux加強安全性)。

More Related