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 参数即可搞定。

Category: PHP / Zend  Tags:
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
3 Responses
  1. 凡客诚品 says:

    很喜欢你的博客想和你做个友情连接!!
    方便以后访问~~你的链接已经做好咯~~
    网站名称:凡客诚品
    网站地址:www.redcu.cn/

  2. ben says:

    非常喜欢你的blog。我叫ben。也是做linux系统运维工作的。

  3. Michael says:

    [Comment ID #31028 Will Be Quoted Here]

    谢谢支持,欢迎多交流,相互学习提高。

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