Loose-Info.com

Last Update 2019/12/24


TOP - 手順書集 - PHP5(FreeBSD)

・PHP5のインストール
%su # cd /usr/ports/lang/php5 # cp Makefile Makefile_old # vi Makefile -- 追加 -- CONFIGURE_ARGS= --enable-versioning \ --enable-memory-limit \ --with-layout=GNU \ --with-config-file-scan-dir=${PREFIX}/etc/php \ --disable-all \ --enable-libxml \ --with-libxml-dir=${LOCALBASE} \ --enable-reflection \ --with-pcre-regex \ ← 追加 --enable-mbstring \ ← 追加 --enable-mbregex \ ← 追加 --enable-mbstr-enc-trans \ ← 追加 --enable-zend-multibyte \ ← 追加 --enable-session \ ← 追加 --enable-spl \ --program-prefix="" # make extract オプション選択 → Build Apache Module Enable Zend multibyte support # make # make install # cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini # vi /usr/local/etc/php.ini -- 変更 -- output_handler = "mb_output_handler" default_charset = "EUC-JP" [mbstring] mbstring.language = Japanese mbstring.internal_encoding = EUC-JP mbstring.http_input = auto mbstring.http_output = EUC-JP mbstring.encoding_translation = On mbstring.detect_order = auto mbstring.substitute_character = none; # vi /usr/local/etc/apache/httpd.conf -- 追加 -- AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps # reboot

・PHPの動作確認用スクリプト
<?php phpinfo() ?>