php5

cd  /usr/ports/lang/php5

make  BATCH=yes  install  clean

cd  ../php5-extensions

make  BATCH=yes  WITH_GD=yes  WITH_MBSTRING=yes  WITH_MYSQL=yes  WITH_PGSQL=yes  install  clean

apache  の設定変更

ee  /usr/local/etc/apache22/httpd.conf

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.cgiDirectoryIndex index.html index.htm index.cgi index.php変更(index.phpを許可)
</IfModule>

<IfModule mime_module>
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddType application/x-httpd-php .php追加(.phpファイルを使えるようにする)
</IfModule>

php.ini 設定

cp  /usr/local/etc/php.ini-production  /usr/local/etc/php.ini

chmod  640  /usr/local/etc/php.ini

ee  /usr/local/etc/php.ini

 short_open_tag = Offshort_open_tag = On変更(short_open_tagを許可)

 expose_php = Onexpose_php = Off変更(バージョンを隠す)

 max_execution_time = 30max_execution_time = 300変更(スクリプト実行時間)

 ;default_charset = "iso-8859-1"default_charset = "UTF-8"コメント解除&変更(デフォルト文字コード)

 upload_max_filesize = 2Mupload_max_filesize = 20M変更(最大アップロードサイズ)

 ;date.timezone =date.timezone = Asia/Tokyoコメント解除&変更(タイムゾーン指定)

 ;mbstring.language = Japanesembstring.language = Japaneseコメント解除(デフォルト言語)

 ;mbstring.internal_encoding = EUC-JPmbstring.internal_encoding = UTF-8コメント解除&変更(内部文字エンコーディングのデフォルト値)

 ;mbstring.http_input = auto mbstring.http_input = autoコメント解除(HTTP入力文字エンコーディング)

 ;mbstring.http_output = SJISmbstring.http_output = passコメント解除&変更(HTTP出力文字エンコーディング)

 ;mbstring.encoding_translation = Offmbstring.encoding_translation = Onコメント解除&変更(内部文字エンコーディングの有効・無効)

 ;mbstring.detect_order = autombstring.detect_order = autoコメント解除(文字コード検出のデフォルト値)

 ;mbstring.substitute_character = none;mbstring.substitute_character = none;コメント解除(無効な文字を代替する文字を定義)

apache 再起動

/usr/local/etc/rc.d/apache22 restart

ee  /usr/local/www/apache22/data/info.php  作成

<?php
   phpinfo();
?>

ブラウザで確認 ( http://tommybsd.plala.jp/info.php )

php5

This entry was posted in FreeBSD. Bookmark the permalink.