Skip to content

Commit 95f1386

Browse files
authored
Suggest printing some information when troubleshooting
1 parent 1725c8a commit 95f1386

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

TROUBLESHOOTING.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@ Compare your version of curl with latest release listed on [curl's releases page
2323
error_reporting(E_ALL);
2424
```
2525

26+
### Print some information that may hint at the cause of failure
27+
28+
```php
29+
error_reporting(E_ALL);
30+
$curl = new Curl();
31+
$curl->get('https://www.example.com/');
32+
echo 'error: ' . $curl->error . "\n";
33+
echo 'errorCode: ' . $curl->errorCode . "\n";
34+
echo 'errorMessage: ' . $curl->errorMessage . "\n";
35+
echo 'curlError: ' . $curlError . "\n";
36+
echo 'curlErrorCode: ' . $curlErrorCode . "\n";
37+
echo 'curlErrorMessage: ' . $curlErrorMessage . "\n";
38+
echo 'httpError: ' . $httpError . "\n";
39+
echo 'httpStatusCode: ' . $httpStatusCode . "\n";
40+
echo 'httpErrorMessage: ' . $httpErrorMessage . "\n";
41+
echo 'requestHeaders:' . "\n";
42+
var_dump($curl->requestHeaders);
43+
echo 'responseHeaders:' . "\n";
44+
var_dump($curl->responseHeaders);
45+
```
46+
2647
### Turn on verbose mode
2748

2849
```php

0 commit comments

Comments
 (0)