Search code examples
phpcurlinclude-path

How do I allow PHP to use curl?


When I try to use the program /usr/bin/curl from within PHP I get the error

Warning: file_exists(): open_basedir restriction in effect. File(/usr/bin/curl) is not within the allowed path(s): (/usr/share/php/:/tmp/:/usr/share/pear/) in /var/www/check.inc.php on line 138

How can i enable this on debian wheezy with PHP 5.4?


Solution

  • it worked by adding the path to curl to the ini.include-path:

    I added this line in my apache config for this site:

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