默认PHP函数被解释为Symfony中Composer的库函数

问题描述 投票:0回答:1

我有一个这样的课:

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

我不确定这里发生了什么变化。任何帮助都会很棒。

php symfony
1个回答
2
投票

似乎机器上缺少卷曲延伸。您可以通过将其作为依赖项添加到composer.json来确保它已安装:

"require": {
    "ext-curl": "*",
    ...
}
© www.soinside.com 2019 - 2024. All rights reserved.