Not working on Laravel Controller, Working on Tinker
up vote
0
down vote
favorite
Guzzle version(s) affected: 6.3 Laravel: 5.6.3 PHP: 7.2.10
Description
If I am trying to get response in tinker
$client = new GuzzleHttpClient();
$response = $client->get($url);
json_decode($response->getBody())
I am getting response as expected.
but in my controller
$object_res = $client->get($url);
I am getting error
"cURL error 3: malformed (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)",…}
Which means, the url is incorrect, but as I have described, this working perfectly in tinker.
Note
I am getting everything working perfectly in my localhost, this is occurring only on my test server.
Please let me know, if I need to give additional information.
laravel curl laravel-5 guzzle guzzlehttp
add a comment |
up vote
0
down vote
favorite
Guzzle version(s) affected: 6.3 Laravel: 5.6.3 PHP: 7.2.10
Description
If I am trying to get response in tinker
$client = new GuzzleHttpClient();
$response = $client->get($url);
json_decode($response->getBody())
I am getting response as expected.
but in my controller
$object_res = $client->get($url);
I am getting error
"cURL error 3: malformed (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)",…}
Which means, the url is incorrect, but as I have described, this working perfectly in tinker.
Note
I am getting everything working perfectly in my localhost, this is occurring only on my test server.
Please let me know, if I need to give additional information.
laravel curl laravel-5 guzzle guzzlehttp
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Guzzle version(s) affected: 6.3 Laravel: 5.6.3 PHP: 7.2.10
Description
If I am trying to get response in tinker
$client = new GuzzleHttpClient();
$response = $client->get($url);
json_decode($response->getBody())
I am getting response as expected.
but in my controller
$object_res = $client->get($url);
I am getting error
"cURL error 3: malformed (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)",…}
Which means, the url is incorrect, but as I have described, this working perfectly in tinker.
Note
I am getting everything working perfectly in my localhost, this is occurring only on my test server.
Please let me know, if I need to give additional information.
laravel curl laravel-5 guzzle guzzlehttp
Guzzle version(s) affected: 6.3 Laravel: 5.6.3 PHP: 7.2.10
Description
If I am trying to get response in tinker
$client = new GuzzleHttpClient();
$response = $client->get($url);
json_decode($response->getBody())
I am getting response as expected.
but in my controller
$object_res = $client->get($url);
I am getting error
"cURL error 3: malformed (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)",…}
Which means, the url is incorrect, but as I have described, this working perfectly in tinker.
Note
I am getting everything working perfectly in my localhost, this is occurring only on my test server.
Please let me know, if I need to give additional information.
laravel curl laravel-5 guzzle guzzlehttp
laravel curl laravel-5 guzzle guzzlehttp
asked Nov 21 at 6:07
Prafulla Kumar Sahu
2,92362146
2,92362146
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
Tinker uses a different runtime than your application, this could be causing an issue because in one scenario. php goes directly from your box to the api server and in the other it goes through your webserver before making the request.
The first thing to do would be to clear your laravel cache and config with
php artisan cache:clear
and
php artisan config:clear
if that fails I would look into the cross-domain restrictions or settings on your web server.
I have already tried this already by taking reference from github issue.
– Prafulla Kumar Sahu
Nov 21 at 6:18
add a comment |
up vote
0
down vote
Please check for Guzzle requirements on your server. specially
To use the PHP stream handler, allow_url_fopen must be enabled in your system's php.ini.
That is enable.
– Prafulla Kumar Sahu
Nov 22 at 9:35
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Tinker uses a different runtime than your application, this could be causing an issue because in one scenario. php goes directly from your box to the api server and in the other it goes through your webserver before making the request.
The first thing to do would be to clear your laravel cache and config with
php artisan cache:clear
and
php artisan config:clear
if that fails I would look into the cross-domain restrictions or settings on your web server.
I have already tried this already by taking reference from github issue.
– Prafulla Kumar Sahu
Nov 21 at 6:18
add a comment |
up vote
0
down vote
Tinker uses a different runtime than your application, this could be causing an issue because in one scenario. php goes directly from your box to the api server and in the other it goes through your webserver before making the request.
The first thing to do would be to clear your laravel cache and config with
php artisan cache:clear
and
php artisan config:clear
if that fails I would look into the cross-domain restrictions or settings on your web server.
I have already tried this already by taking reference from github issue.
– Prafulla Kumar Sahu
Nov 21 at 6:18
add a comment |
up vote
0
down vote
up vote
0
down vote
Tinker uses a different runtime than your application, this could be causing an issue because in one scenario. php goes directly from your box to the api server and in the other it goes through your webserver before making the request.
The first thing to do would be to clear your laravel cache and config with
php artisan cache:clear
and
php artisan config:clear
if that fails I would look into the cross-domain restrictions or settings on your web server.
Tinker uses a different runtime than your application, this could be causing an issue because in one scenario. php goes directly from your box to the api server and in the other it goes through your webserver before making the request.
The first thing to do would be to clear your laravel cache and config with
php artisan cache:clear
and
php artisan config:clear
if that fails I would look into the cross-domain restrictions or settings on your web server.
answered Nov 21 at 6:13
dvl333
495
495
I have already tried this already by taking reference from github issue.
– Prafulla Kumar Sahu
Nov 21 at 6:18
add a comment |
I have already tried this already by taking reference from github issue.
– Prafulla Kumar Sahu
Nov 21 at 6:18
I have already tried this already by taking reference from github issue.
– Prafulla Kumar Sahu
Nov 21 at 6:18
I have already tried this already by taking reference from github issue.
– Prafulla Kumar Sahu
Nov 21 at 6:18
add a comment |
up vote
0
down vote
Please check for Guzzle requirements on your server. specially
To use the PHP stream handler, allow_url_fopen must be enabled in your system's php.ini.
That is enable.
– Prafulla Kumar Sahu
Nov 22 at 9:35
add a comment |
up vote
0
down vote
Please check for Guzzle requirements on your server. specially
To use the PHP stream handler, allow_url_fopen must be enabled in your system's php.ini.
That is enable.
– Prafulla Kumar Sahu
Nov 22 at 9:35
add a comment |
up vote
0
down vote
up vote
0
down vote
Please check for Guzzle requirements on your server. specially
To use the PHP stream handler, allow_url_fopen must be enabled in your system's php.ini.
Please check for Guzzle requirements on your server. specially
To use the PHP stream handler, allow_url_fopen must be enabled in your system's php.ini.
answered Nov 21 at 12:28
guttume
563
563
That is enable.
– Prafulla Kumar Sahu
Nov 22 at 9:35
add a comment |
That is enable.
– Prafulla Kumar Sahu
Nov 22 at 9:35
That is enable.
– Prafulla Kumar Sahu
Nov 22 at 9:35
That is enable.
– Prafulla Kumar Sahu
Nov 22 at 9:35
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53406151%2fnot-working-on-laravel-controller-working-on-tinker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown