歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Unix知識 >> BSD

在 FreeBSD 6.1 安裝 Apache+MySQL+PHP


底下以 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
Starting MySQL.. SUCCESS!
設定 MySQL Server 的 root 密碼(密碼請自訂,後面一行的主機名稱請自行更改)
/usr/local/bin/mysqladmin -u root 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
加入下面幾行,才能支援 PHP
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
DirectoryIndex index.php index.htm index.html index.pl index.cgi
#複製 php.ini-dist 成為 php.ini
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
設定開機時啟動
mysql_enable="YES"
apache22_enable="YES"
Copyright © Linux教程網 All Rights Reserved