LoginSignup
0
0

More than 5 years have passed since last update.

【VPS】ServerMan@VPSにPukiWikiを導入する

Posted at

初めてVPSを借りたので、前々から気になっていたPukiWikiを導入してみようとした時のメモ

【構成】
・ServerMan@VPS(Entryモデル)
・CentOS7
・Apache2.4
・PHP5.4
・PukiWiki1.4-7

必要なパッケージをインストールする

PukiWikiはPHPでできているため、PHPとPHP-mbstringを入れる。

yum install httpd php php-mbstring

Wikiモジュールの展開

tar xvzf pukiwiki-1.4.7_notb_utf8.tar.gz -C /var/www/html/
cd /var/www/html
mv pukiwiki-1.4.7_notb_utf8 wiki


http://pukiwiki.osdn.jp/?PukiWiki/Download/1.4.7

Apache起動

/sbin/httpd -k start

問題

アクセスしてみたのですが、真っ白なページが表示されてしまいました。
対処として、以下を実施。
①pukiwikiをデバッグモードにする
index.phpの9~10行目を変更します。
・変更前
error_reporting(E_ERROR | E_PARSE); // Avoid E_WARNING, E_NOTICE, etc
//error_reporting(E_ALL); //Debug purpose ← 下がコメントアウトされている

・変更後
//error_reporting(E_ERROR | E_PARSE); // Avoid E_WARNING, E_NOTICE, etc ←こちらをコメントアウト
error_reporting(E_ALL); // Debug purpose

再度、初期ページにアクセスします。
Apacheのログにエラーログが挙がりました。
[Mon Jul xx xx:xx:xx 2015] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error: Cannot redeclare hex2bin() in /var/www/html/pukiwiki/lib/func.php on line 317

②func.phpの追記
ネットで調べていたらPHPのバージョンが問題だったようです。
以下の箇所に2行追記します。

// Inversion of bin2hex()
if (! function_exists(‘hex2bin’)) {  ←追記します。
function hex2bin($hex_string)
{
// preg_match : Avoid warning : pack(): Type H: illegal hex digit …
// (string) : Always treat as string (not int etc). See BugTrack2/31
return preg_match(‘/^[0-9a-f]+$/i’, $hex_string) ?
pack(‘H*’, (string)$hex_string) : $hex_string;
}
}  ←追記します。

以上の対処で表示できるようになりました。
これからいろいろといじっていきます。

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0