我有一个这样的课:
namespace my\namespace;
use this\object;
include("a/b/c/vendor/autoload.php");
class TestClass
{
public function index()
{
$url = "www.myweb.com";
$ch = curl_init($url);
// ... do more things
}
}
在交响乐中。
这曾经工作到昨天,现在PHP认为curl_init
是一个不同的功能,我得到这个错误:
Attempted to call function "curl_init" from namespace "my\namespace"
PHPStorms说curl_init is missing from composer.json
。
我正在使用Symfony中包含的Web服务器(php bin/console server:start
)
我不确定这里发生了什么变化。任何帮助都会很棒。
似乎机器上缺少卷曲延伸。您可以通过将其作为依赖项添加到composer.json来确保它已安装:
"require": {
"ext-curl": "*",
...
}