Skip to content

Works in Localhost does not work in webserver #235

@sriducati

Description

@sriducati

I am trying to fetch contents from

https://some.com/suggestions.php?q=kann

include('./Request/library/Requests.php');
Requests::register_autoloader();
$request = Requests::get('https://some.com/suggestions.php?q=kann',array('Accept' => 'application/json'));
echo json_encode($request->body);

Above code works fine when we run on localHost But I get

"500 Internal server error

PhP Error Shows

`

Fatal error: Uncaught exception 'Requests_Exception' with message 'cURL error 28: Operation timed out after 10000 milliseconds with 0 bytes received' in /home/admin/domains/domain.com/public_html/Request/library/Requests/Transport/cURL.php:277 Stack trace: #0 /home/admin/domains/domain.com/public_html/Request/library/Requests/Transport/cURL.php(120): Requests_Transport_cURL->process_response(false, Array) #1 /home/admin/domains/domain.com/public_html/Request/library/Requests.php(317): Requests_Transport_cURL->request('https://some.com...', Array, NULL, Array) #2 /home/admin/domains/domain.com/public_html/Request/library/Requests.php(194): Requests::request('https://some.com...', Array, NULL, 'GET', Array) #3 /home/admin/domains/domain.com/public_html/Request/examples/get.php(14): Requests::get('https://some.com...', Array) #4 {main} thrown in /home/admin/domains/domain.com/public_html/Request/library/Requests/Transport/cURL.php on line 277

`

when run on webserver, is there any way to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions