BSD下Pecl报告undefined function preg_match()错误处理

默认情况下,BSD的ports安装的PECL命令,会出现错误:
# pecl
Fatal error: Call to undefined function preg_match() in …

问题的原因是出在 /usr/local/bin/pecl 的最后一行:

exec $PHP -C -n -q $INCARG -d output_buffering=1 -d safe_mode=0 …

这行代码里面的 -n 参数表示不加载PHP的配置文件 php.ini ,因此 pcre.so 就不会被加载而导致错误,
,你只要改一下这行代码,去掉 -n 参数即可搞定。

3 thoughts on “BSD下Pecl报告undefined function preg_match()错误处理”

Leave a Reply

Your email address will not be published. Required fields are marked *

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image