在 FreeBSD 6.1 安裝 Apache+MySQL+PHP

2009-05-13 05:19:45来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


        底下以 Port 來安裝
#安裝 MySQL Server
cd /usr/ports/database/mysql50-server
make install clean


make WITH_CHARSET=big5 WITH_XCHARSET=all install clean
更改 /var/db/mysql 目錄的權限
chown -R mysql:mysql /var/db/mysql/
啟動 MySQL Server
/usr/local/share/mysql/mysql.server start
Starting MySQL.. SUCCESS!
設定 MySQL Server 的 root 密碼(密碼請自訂,後面一行的主機名稱請自行更改)
/usr/local/bin/mysqladmin -u root password '123456'
/usr/local/bin/mysqladmin -u root -h freebsd.test.com password '123456'

#安裝 Apache Web Server
cd /usr/ports/www/apache22
make install clean

#安裝 PHP5
cd /usr/ports/lang/php5
make install clean

會出現一個選單
[X] CLI Build CLI version
[X] CGI Build CGI version
[X] APACHE Build Apache module
[X] FASTCGI Enable fastcgi support (CGI only)
[X] PATHINFO Enable path-info-check support (CGI only)

#安裝 PHP5-Extensions
cd /usr/ports/lang/php5-extensions
#選擇所需要的延伸套件
make config
[X] BZ2 bzip2 library support
[X] CTYPE ctype functions
[X] DOM DOM support
[X] GD GD library support
[X] GETTEXT gettext library support
[X] HASH HASH Message Digest Framework
[X] ICONV iconv support
[X] MBSTRING multibyte string support
[X] MCRYPT Encryption support
[X] MYSQL MySQL database support
[X] ODBC unixODBC support
[X] PCRE Perl Compatible Regular Expression support
[X] PDO PHP Data Objects Interface (PDO)
[X] POSIX POSIX-like functions
[X] SESSION session support
[X] SIMPLEXML simplexml support
[X] SQLITE sqlite support
[X] TOKENIZER tokenizer support
[X] XML XML support
[X] XMLREADER XMLReader support
[X] XMLWRITER XMLWriter support
[X] ZLIB ZLIB support

#因為 Extensions 有選 GD library 所以必須要選擇加裝 T1LIB 及 TRUETYPE 同時 SQLITE 也必須選擇是否開啟 UTF-8 編碼
Options for php5-gd 5.1.6
[X] T1LIB Include T1lib support
[X] TRUETYPE Enable TrueType string function

# PHP 下的精簡型文字資料庫 Text Database
Options for php5-sqlite 5.1.6
[X] UTF8 Enable UTF-8 support

#修改 httpd.conf 設定檔
vi /usr/local/etc/apache22/httpd.conf
加入下面幾行,才能支援 PHP
AddType application/x-httpd-php .php

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Grub on FreeBSD

下一篇:在 FreeBSD 6 上用 Ports 來安裝 Apache+MySQL+PHP