【问题标题】:How do I allow PHP to use curl?如何允许 PHP 使用 curl?
【发布时间】:2015-04-19 13:07:20
【问题描述】:

当我尝试在 PHP 中使用程序 /usr/bin/curl 时,出现错误

警告:file_exists():open_basedir 限制生效。文件 (/usr/bin/curl) 不在允许的路径中:/var/www/check.inc 中的 (/usr/share/php/:/tmp/:/usr/share/pear/)。第138行的php

如何使用 PHP 5.4 在 debian wheezy 上启用此功能?

【问题讨论】:

    标签: php curl include-path


    【解决方案1】:

    通过将 curl 的路径添加到 ini.include-path:

    我在我的 apache 配置中为此站点添加了这一行:

    php_admin_value open_basedir "/usr/share/php/:/tmp/:/usr/share/pear/:/usr/bin/curl"
    

    【讨论】:

      猜你喜欢
      • 2016-05-31
      • 2019-09-13
      • 1970-01-01
      • 2012-05-13
      • 2011-11-20
      • 2019-10-02
      • 1970-01-01
      • 2010-12-16
      • 1970-01-01
      相关资源
      最近更新 更多