安裝php5 配合第二步請安裝時加裝cgi fastcgi
==============================
記得勾選APACHE Build Apache module不然Apache不認得PHP
# cd /usr/ports/lang/php5
# make config install clean
==============================
php.ini檔
==============================
複製 php.ini-dist 到 php.ini
# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
修改php.ini
output_buffering = 8192
; Maximum size of POST data that PHP will accept.
post_max_size = 64M
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = /tmp
; Maximum allowed size for uploaded files.用於上傳資料庫資料時可設定
upload_max_filesize = 128M
[Date]
; Defines the default timezone used by the date functions
date.timezone = Asia/Taipei ;加入Asia/Taipei時區
; where MODE is the octal representation of the mode. Note that this
; does not overwrite the process's umask.
session.save_path = "/tmp"
再安裝php5-extensions
勾選(上網所收集的..搞不太懂,又找不到什麼資料可看,英文能力太差,看不懂)反正別人用就跟著用吧= ="
CTYPE、EXIF、GD、ICONV、IMAP、MBSTRING、MYSQL、MYSQLI、PCRE、SESSION、XML、ZIP、ZLIB
# cd /usr/ports/lang/php5-extensions
# make config install clean
以上模組建議都以內定值安裝,如果懂得用就自行設定吧^^
==============================
安裝php5-extensions(mysqli時出現無法安裝解決方式)
==============================
錯誤訊息如下:
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c: In function 'zm_startup_mysqli':
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:637: error: 'MYSQL_RPL_MASTER' undeclared (first use in this function)
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:637: error: (Each undeclared identifier is reported only once
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:637: error: for each function it appears in.)
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:638: error: 'MYSQL_RPL_SLAVE' undeclared (first use in this function)
/usr/ports/databases/php5-mysqli/work/php-5.2.12/ext/mysqli/mysqli.c:639: error: 'MYSQL_RPL_ADMIN' undeclared (first use in this function)
解決方式:
# ee /usr/local/include/mysql/mysql.h
編輯內容
找到這段
/*原文 start
enum mysql_protocol_type
{
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
原文 end*/
/*
There are three types of queries - the ones that have to go to
the master, the ones that go to a slave, and the adminstrative
type which must happen on the pivot connectioin
*/
新增
enum mysql_rpl_type
{
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
};
/*原文 start
typedef struct character_set
{
unsigned int number; /* character set number */
unsigned int state; /* character set state */
const char *csname; /* collation name */
const char *name; /* character set name */
原文 end */
==============================
extensions.ini檔
==============================
/usr/local/etc/php/extensions.ini
==============================
移除 php5-extensions 要用
==============================
# pkg_deinstall -r php5-extensions
這樣子才會把 php5-extensions 下面那些散落在各個目錄的 extensions 移除。php5-extensions 只是個用 dependency 導到各個目錄去裝 extension 的 meta port 而已。
==============================
安裝phpMyAdmin
==============================
# cd /usr/ports/databases/phpmyadmin # 安裝 phpMyAdmin
# make install clean
複製config檔修改
# cd /usr/local/www/phpMyAdmin # 切換目錄
# cp config.sample.php config.inc.php
# vi config.inc.php
//找到$cfg['Servers'][$i]['auth_type']修改線上認證方式 http 認證
$cfg['Servers'][$i]['auth_type'] = 'http';
//增加此行,遮蔽information_schema資料庫,雖不能修改但使用者皆會看到此資料庫,不顯示它
$cfg['Servers'][$i]['hide_db'] = 'information_schema';
# chmod 644 config.inc.php //儲存config.inc.php後 變更權限644
# vi /usr/local/etc/apache22/httpd.conf # 編輯 Apache 的設定檔加入下列幾行
Alias /phpmyadmin/ "/usr/local/www/phpMyAdmin/"
<Directory "/usr/local/www/phpMyAdmin/">
Options none
AllowOverride Limit
Order Deny,Allow
Deny from all
Allow from 127.0.0.1 192.168.1.0/24
</Directory>
沒有留言:
張貼留言