Thursday, 14 April 2016

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?



Answer



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"

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...