Skip to content

Commit

Permalink
Suggest printing some information when troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
zachborboa committed May 1, 2020
1 parent 1725c8a commit 95f1386
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ Compare your version of curl with latest release listed on [curl's releases page
error_reporting(E_ALL);
```

### Print some information that may hint at the cause of failure

```php
error_reporting(E_ALL);
$curl = new Curl();
$curl->get('https://www.example.com/');
echo 'error: ' . $curl->error . "\n";
echo 'errorCode: ' . $curl->errorCode . "\n";
echo 'errorMessage: ' . $curl->errorMessage . "\n";
echo 'curlError: ' . $curlError . "\n";
echo 'curlErrorCode: ' . $curlErrorCode . "\n";
echo 'curlErrorMessage: ' . $curlErrorMessage . "\n";
echo 'httpError: ' . $httpError . "\n";
echo 'httpStatusCode: ' . $httpStatusCode . "\n";
echo 'httpErrorMessage: ' . $httpErrorMessage . "\n";
echo 'requestHeaders:' . "\n";
var_dump($curl->requestHeaders);
echo 'responseHeaders:' . "\n";
var_dump($curl->responseHeaders);
```

### Turn on verbose mode

```php
Expand Down

0 comments on commit 95f1386

Please sign in to comment.