FreeNAS 9のJail環境でWordpressを動作させ記事を投稿できるところまで作業が完了しました
ただマルチバイト処理のプラグインが有効になりません
Install WordPress on FreeNAS 9 – Configuring WordPress
http://www.rootlinks.net/2013/11/19/install-wordpress-on-freenas-9-configuring-wordpress/
このままだとスッキリしないのでphp関連のプログラムを調べてみました
php5にはmbstring関係のオプション設定は無いようです
- PHP-extensionsオプション
- MBSTRING=on
- make
- make deinstall
- make reinstall
- make clean
- php.iniの編集
- phpinfo()
- php-fpm restart
PHP-extensionsにmbstringのオプションがありました
1 2 3 4 |
; html-script: false ] root@vhost:/ # cd /usr/ports/lang/php5-extensions/ root@vhost:/usr/ports/lang/php5-extensions # make showconfig | grep MBSTRING MBSTRING=off: multibyte string support |
MBSTRING=onに変更して再インストールを行います
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
; html-script: false ] root@vhost:/usr/ports/lang/php5-extensions # make config root@vhost:/usr/ports/lang/php5-extensions # make showconfig | grep =on CTYPE=on: ctype functions CURL=on: CURL support DOM=on: DOM support FILTER=on: input filter support HASH=on: HASH Message Digest Framework ICONV=on: iconv support JSON=on: JavaScript Object Serialization support MBSTRING=on: multibyte string support MYSQL=on: MySQL database support PDO=on: PHP Data Objects Interface (PDO) PDO_SQLITE=on: PDO sqlite driver PHAR=on: phar support POSIX=on: POSIX-like functions SESSION=on: session support SIMPLEXML=on: simplexml support SQLITE3=on: sqlite3 support TOKENIZER=on: tokenizer support XML=on: XML support XMLREADER=on: XMLReader support XMLWRITER=on: XMLWriter support |
1 2 3 4 5 6 7 8 9 10 11 12 |
; html-script: false ] root@vhost:/usr/ports/lang/php5-extensions # make clean ===> Cleaning for php5-extensions-1.7 root@vhost:/usr/ports/lang/php5-extensions # make ===> Found saved configuration for php5-extensions-1.7 ===> php5-extensions-1.7 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by php5-extensions-1.7 for building ===> Extracting for php5-extensions-1.7 ===> Patching for php5-extensions-1.7 (snip) ===> php5-extensions-1.7 depends on file: /usr/local/lib/php/20100525/xmlwriter.so - found ===> Configuring for php5-extensions-1.7 |
すでにphp5-extensionsはインストール済みなのでmake deinstallを実行します
1 2 3 4 5 6 7 8 |
; html-script: false ] root@vhost:/usr/ports/lang/php5-extensions # make deinstall ===> Deinstalling for lang/php5-extensions ===> Deinstalling Deinstallation has been requested for the following 1 packages: php5-extensions-1.7 [1/1] Deleting php5-extensions-1.7... done |
1 2 3 4 5 6 7 8 9 10 11 12 |
; html-script: false ] root@vhost:/usr/ports/lang/php5-extensions # make reinstall ===> Staging for php5-extensions-1.7 ===> php5-extensions-1.7 depends on file: /usr/local/include/php/main/php.h - found ===> php5-extensions-1.7 depends on file: /usr/local/lib/php/20100525/ctype.so - found (snip) ===> php5-extensions-1.7 depends on file: /usr/local/lib/php/20100525/xmlwriter.so - found ===> Generating temporary packing list ====> Compressing man pages (compress-man) ===> Installing for php5-extensions-1.7 ===> Registering installation for php5-extensions-1.7 Installing php5-extensions-1.7... done |
1 2 3 4 |
; html-script: false ] root@vhost:/usr/ports/lang/php5-extensions # make clean ===> Cleaning for php5-mbstring-5.4.21 ===> Cleaning for php5-extensions-1.7 |
/usr/local/etc/php.iniのmbstring関連の項目を編集します
現在はこんな設定です
1 2 3 4 5 6 7 8 9 10 |
; html-script: false ]root@vhost:/root # grep mbstring /usr/local/etc/php.ini | grep -v ";" [mbstring] mbstring.language = Japanese mbstring.internal_encoding = UTF-8 mbstring.http_input = auto mbstring.http_output = auto mbstring.encoding_translation = Off mbstring.detect_order = auto mbstring.func_overload = 0 mbstring.strict_detection = Off |
試しにphpinfo()でphpの情報を確認します
“Zend Multibyte Support => provided by mbstring”とあるから組み込まれているようです
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
; html-script: false ] root@vhost:/root # cd /usr/local/www/wordpress/ root@vhost:/usr/local/www/wordpress # echo '<?php echo phpinfo(); ?>' > phpinfo.php root@vhost:/usr/local/www/wordpress # php phpinfo.php | grep mbstring Zend Multibyte Support => provided by mbstring mbstring mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1. mbstring.detect_order => auto => auto mbstring.encoding_translation => Off => Off mbstring.func_overload => 0 => 0 mbstring.http_input => auto => auto mbstring.http_output => auto => auto mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml) mbstring.internal_encoding => UTF-8 => UTF-8 mbstring.language => Japanese => Japanese mbstring.strict_detection => Off => Off mbstring.substitute_character => no value => no value |
php-fpmを再起動します
1 2 3 4 |
; html-script: false ] root@vhost: # /usr/local/etc/rc.d/php-fpm restart Stopping php_fpm. Starting php_fpm. |
WordPressにログインしてプラグイン”wp multibyte patch”の有効を行うと成功しました
実はApacheの時のように/usr/local/etc/rc.d/nginx restartを何度もやってたんですよね(笑)
1 2 3 4 5 6 7 8 9 10 11 |
; html-script: false ] root@vhost:/root # /usr/local/etc/rc.d/nginx restart Performing sanity check on nginx configuration: nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful Stopping nginx. Waiting for PIDS: 66212. Performing sanity check on nginx configuration: nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful Starting nginx. |
それでもwp multibyte patchが有効にならないのでコーヒーブレイクのあとに閃いたんです
もしかしてphp-fpmの再起動か