我刚安装了带有默认选项的pecl_http,并在我的活动php.ini配置文件中添加了“extension = http.so”行,但是当我运行我的脚本时,我仍然得到
调用未定义的函数http_post_fields()
关于我可以检查以解决问题的任何想法?
以下是代码:
$url = "http://localhost/elistings/public/dynamicSearch.php";
$data = array("phone_number" => "",
"business_name" => "name",
"business_address" => "my address",
"city_and_state" => "city, CA",
);
$response = http_post_fields($url, $data);
echo $response;
答案 0 :(得分:0)
在验证pecl_http已成功安装后,您是否尝试过 this ?
我们必须激活模块,不要修改文件/etc/php.ini, 但在/etc/php.d
中添加文件pecl_http.ini; Enable pecl_http extension module extension=http.so
重启Apache