在子文件夹中启用curl_exec()

Curl在服务器上启用,但curl_exec函数由于安全原因被禁用。

disable_functions = exec,passthru,shell_exec,system,proc_open,popen, curl_exec,curl_multi_exec,parse_ini_file,show_source 

我知道我可以从php.ini启用这个function,但会影响整个服务器。 你能帮我build议如何激活这个function(curl_exec)只为一个特定的子文件夹? 我尝试使用.htaccess但没有运气。

disable_functions指令必须在php.ini设置。 你不能在httpd.conf.htaccess设置它。

请参阅文档: http : //php.net/manual/en/ini.core.php#ini.disable-functions

如果你需要对每个目录的函数有不同的限制,你可以使用单独的PHP-FPM实例,每个实例都可以有自己的php.ini

另见: http : //php-fpm.org/