CURLOPT_HEADER - предполагается CURLOPT_HEADER в laravel 6 - PullRequest
0 голосов
/ 08 апреля 2020

Я сделал это:

martin@martin:/etc/php/7.4/apache2$  php -m | grep curl
curl
martin@martin:/etc/php/7.4/apache2$ sudo apt-get install php7.4-curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php7.4-curl is already the newest version (7.4.4-1+ubuntu16.04.1+deb.sury.org+1).
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
martin@martin:/etc/php/7.4/apache2

Но я все еще получаю ошибку:

{
    "message": "Use of undefined constant CURLOPT_HEADER - assumed 'CURLOPT_HEADER' (this will throw an Error in a future version of PHP)",
    "exception": "ErrorException",
    "file": "/var/www/trivia-web-service/vendor/php-http/curl-client/src/Client.php",
    "line": 194,
    "trace": [
        {
            "file": "/var/www/trivia-web-service/vendor/php-http/curl-client/src/Client.php",
            "line": 194,
            "function": "handleError",
            "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/php-http/curl-client/src/Client.php",
            "line": 114,
            "function": "createCurlOptions",
            "class": "Http\\Client\\Curl\\Client",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/php-http/client-common/src/PluginClient.php",
            "line": 82,
            "function": "sendRequest",
            "class": "Http\\Client\\Curl\\Client",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/php-http/client-common/src/PluginClient.php",
            "line": 175,
            "function": "Http\\Client\\Common\\{closure}",
            "class": "Http\\Client\\Common\\PluginClient",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/php-http/client-common/src/PluginClient.php",
            "line": 88,
            "function": "Http\\Client\\Common\\{closure}",
            "class": "Http\\Client\\Common\\PluginClient",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/okta/jwt-verifier/src/Request.php",
            "line": 92,
            "function": "sendRequest",
            "class": "Http\\Client\\Common\\PluginClient",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/okta/jwt-verifier/src/Request.php",
            "line": 78,
            "function": "request",
            "class": "Okta\\JwtVerifier\\Request",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/okta/jwt-verifier/src/JwtVerifier.php",
            "line": 68,
            "function": "get",
            "class": "Okta\\JwtVerifier\\Request",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/okta/jwt-verifier/src/JwtVerifierBuilder.php",
            "line": 119,
            "function": "__construct",
            "class": "Okta\\JwtVerifier\\JwtVerifier",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/app/Http/Middleware/AuthenticateWithOkta.php",
            "line": 51,
            "function": "build",
            "class": "Okta\\JwtVerifier\\JwtVerifierBuilder",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/app/Http/Middleware/AuthenticateWithOkta.php",
            "line": 18,
            "function": "isAuthorized",
            "class": "App\\Http\\Middleware\\AuthenticateWithOkta",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "App\\Http\\Middleware\\AuthenticateWithOkta",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php",
            "line": 41,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\SubstituteBindings",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php",
            "line": 59,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Routing\\Middleware\\ThrottleRequests",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 687,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 662,
            "function": "runRouteWithinStack",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 628,
            "function": "runRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
            "line": 617,
            "function": "dispatchToRoute",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 165,
            "function": "dispatch",
            "class": "Illuminate\\Routing\\Router",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 128,
            "function": "Illuminate\\Foundation\\Http\\{closure}",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
            "line": 21,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
            "line": 27,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
            "line": 63,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/fruitcake/laravel-cors/src/HandleCors.php",
            "line": 50,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Fruitcake\\Cors\\HandleCors",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/fideloper/proxy/src/TrustProxies.php",
            "line": 57,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 167,
            "function": "handle",
            "class": "Fideloper\\Proxy\\TrustProxies",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
            "line": 103,
            "function": "Illuminate\\Pipeline\\{closure}",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 140,
            "function": "then",
            "class": "Illuminate\\Pipeline\\Pipeline",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
            "line": 109,
            "function": "sendRequestThroughRouter",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/public/index.php",
            "line": 55,
            "function": "handle",
            "class": "Illuminate\\Foundation\\Http\\Kernel",
            "type": "->"
        },
        {
            "file": "/var/www/trivia-web-service/server.php",
            "line": 21,
            "function": "require_once"
        }
    ]
}

Что может быть причиной этого?

ОБНОВЛЕНИЕ:

от phpinfo()

<table>
  <tbody>
    <tr>
      <td class="e">ctype functions </td>
      <td class="v">enabled </td>
    </tr>
  </tbody>
</table>
<h2><a name="module_curl">curl</a></h2>
<table>
  <tbody>
    <tr>
      <td class="e">cURL support </td>
      <td class="v">enabled </td>
    </tr>
    <tr>
      <td class="e">cURL Information </td>
      <td class="v">7.47.0 </td>
    </tr>
    <tr>
      <td class="e">Age </td>
      <td class="v">3 </td>
    </tr>
    <tr>
      <td class="e">Features </td>
    </tr>
    <tr>
      <td class="e">AsynchDNS </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">CharConv </td>
      <td class="v">No </td>
    </tr>
    <tr>
      <td class="e">Debug </td>
      <td class="v">No </td>
    </tr>
    <tr>
      <td class="e">GSS-Negotiate </td>
      <td class="v">No </td>
    </tr>
    <tr>
      <td class="e">IDN </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">IPv6 </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">krb4 </td>
      <td class="v">No </td>
    </tr>
    <tr>
      <td class="e">Largefile </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">libz </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">NTLM </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">NTLMWB </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">SPNEGO </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">SSL </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">SSPI </td>
      <td class="v">No </td>
    </tr>
    <tr>
      <td class="e">TLS-SRP </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">HTTP2 </td>
      <td class="v">No </td>
    </tr>
    <tr>
      <td class="e">GSSAPI </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">KERBEROS5 </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">UNIX_SOCKETS </td>
      <td class="v">Yes </td>
    </tr>
    <tr>
      <td class="e">PSL </td>
      <td class="v">No </td>
    </tr>
    <tr>
      <td class="e">Protocols </td>
      <td class="v">dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, smb, smbs, smtp, smtps, telnet, tftp </td>
    </tr>
    <tr>
      <td class="e">Host </td>
      <td class="v">x86_64-pc-linux-gnu </td>
    </tr>
    <tr>
      <td class="e">SSL Version </td>
      <td class="v">OpenSSL/1.0.2g </td>
    </tr>
    <tr>
      <td class="e">ZLib Version </td>
      <td class="v">1.2.8 </td>
    </tr>
  </tbody>
</table>
<table>
  <tbody>
    <tr class="h">
      <th>Directive</th>
      <th>Local Value</th>
      <th>Master Value</th>
    </tr>
    <tr>
      <td class="e">curl.cainfo</td>
      <td class="v"><i>no value</i></td>
      <td class="v"><i>no value</i></td>
    </tr>
  </tbody>
</table>

работает php -i | grep -i curl получает меня

martin@martin:/etc/php/7.4/apache2$ php -i | grep -i curl
/etc/php/7.4/cli/conf.d/20-curl.ini,
curl
cURL support => enabled
cURL Information => 7.47.0
curl.cainfo => no value => no value
...