**[[続・質問箱/440]] [#v3d10e40]
|RIGHT:70|LEFT:410|c
|~サマリ| [FreeBSD] Fatal error: Call to undefined function: preg_match() ...|
|~バージョン|1.4.4|
|~投稿者|[[某hiro]]|
|~状態|完了|
|~投稿日|&new{2004-11-16 (火) 21:48:03};|
***質問 [#aa9600fa]
apache1.3.33

PHP4.3.8

FreeBSD4.10において

Fatal error: Call to undefined function: preg_match() in /usr/local/www/data-dist/pukiwiki/lib/init.php on line 92

がでて動作してくれません。質問箱に92行というのはなかったようです。

どうしたらよいのでしょうか。


***回答 [#aa3958cc]
-PHPのPCREが有効になっているか確かめる。 --  &new{2004-11-16 (火) 22:41:20};
-cd /usr/ports/devel/php4-pcre/ && make install --  &new{2004-11-16 (火) 22:50:18};
-推測ですが、phpinfo.php のページを表示させてみて、mbstringの項目がありますか?
なければ、phpがmbstringのオプション付きでコンパイルされてません。
もし、ports では php4.3.8は、オプションなしです。
php4.3.8に加えて、 lang/php4-extensions 入れる必要があります。
# cd /usr/ports/lang/php4-extensions
# make install clean
とすると、コンパイルオプションを選択する画面がでてきます。
ここで、mbstringを選びます。 -- [[iketomo]] &new{2004-11-16 (火) 22:44:09};
-私もはまりました。最近の PHP の FreeBSD ports は、php(4|5) 本体と php(4|5)-extension というmetaportに分離しています。詳しくは [[deb:開発日記/2004-07-23]]をどうぞ。 -- [[henoheno]] &new{2004-11-16 (火) 23:05:20};
-php(4|5)-extensionを既に make install clean しているのであれば、後で追加が必要なextensionが出てきても、そのports(例えばphp-gettext)の中で make install clean とやれば組み込んでくれるはずです。apacheの再起動をお忘れなく。 -- [[henoheno]] &new{2004-11-16 (火) 23:08:49};
-やはり、/usr/ports/UPDATINGをみないといけませんね。20040719です。
20040719:
AFFECTS: users of PHP
AUTHOR: ale@FreeBSD.org
The old lang/php4 and lang/php5 ports have been splitted into 'base' PHP,
PEAR, and shared extensions to allow more flexibility and add new features.
Upgrading your current PHP installation will result in a 'base' PHP
installation (no PEAR and no extensions).
PEAR can be found in the new devel/php4-pear and devel/php5-pear ports, while
the set of PHP extensions to install can be choosen via the meta-ports
lang/php4-extensions and lang/php5-extensions, or installing singular
extensions individually.
If you have a previous php.ini configuration file, be sure to comment out
the extension_dir parameter, since the correct path is statically compiled
into the PHP binary.
For an overview of the modules used with the old PHP binary, use
the command "php -m".-- [[iketomo]] &new{2004-11-16 (火) 23:10:46};
-php4-extensionsをmakeしなおすことでOKでした。自分ではmbstringにチェックを入れていたつもりで実際には入っていなかったのが原因のようです。ご指導ありがとうございます。 -- [[某hiro]] &new{2004-11-21 (日) 18:01:41};
-細かいことですが、誤った情報がPukiWikiの公式サイトに残るのは
好ましくないと思いますので、敢えて補足しておきます。~
 Fatal error: Call to undefined function: preg_match()
の原因は、''mbstringが入っていない為ではありません''。
先に指摘された方もおられますが、pcreが有効になっていないせいです。~
php4-extensionsでmbstringを有効にしてmakeしなおすことで
問題が解決されたのは、php4-extensions/Makefileで~
 WITH_PCRE=   yes
になっている為、意識してPCREのチェックを外さない限り、devel/php4-pcre
がインストールされるせいでしょう。 --  &new{2004-11-21 (日) 18:40:29};
-皆さん補足ありがとうございます :) -- [[henoheno]] &new{2004-11-21 (日) 21:46:14};
-pukiwiki/lib/func.php on line 40のエラーではまってましたが、お陰様で抜け出せました -- [[iTo]] &new{2005-05-24 (火) 13:34:59};

#comment

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 5.6.40-0+deb8u12. HTML convert time: 0.115 sec.

OSDN