Error file_get_contents in Laravel in Jobs
When work the jobs say:
ErrorException: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php:33 Stack trace:
0 [internal function]: IlluminateFoundationBootstrapHandleExceptions->handleError(2, 'file_get_conten...', '/home/mmicube/p...', 33, Array)
1 /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php(33): file_get_contents('https://api.the...')
and more...
But if I try in a page (out of jobs) the file_get_contents() is fine. Why?
I configured the PHP ea-php70:
allow_url_fopen = On
allow_url_include = On
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 32M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 2M
zlib.output_compression = Off
I try with http and https and nothing... don't work.
I using Centos7.5 with cPanel, ea-php70.
phpinfo():

laravel php-7
|
show 4 more comments
When work the jobs say:
ErrorException: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php:33 Stack trace:
0 [internal function]: IlluminateFoundationBootstrapHandleExceptions->handleError(2, 'file_get_conten...', '/home/mmicube/p...', 33, Array)
1 /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php(33): file_get_contents('https://api.the...')
and more...
But if I try in a page (out of jobs) the file_get_contents() is fine. Why?
I configured the PHP ea-php70:
allow_url_fopen = On
allow_url_include = On
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 32M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 2M
zlib.output_compression = Off
I try with http and https and nothing... don't work.
I using Centos7.5 with cPanel, ea-php70.
phpinfo():

laravel php-7
Please do aphpinfo()from inside a laravel view to see the actual config. Maybe the config used by that vhost is not the same as the one you opened. This is likely no laravel issue but simply a configuration issue.
– TimSch
Nov 26 '18 at 15:51
1
Different php.ini for web and cli ... try `php -r 'echo ini_get("allow_url_fopen");'
– simonecosci
Nov 26 '18 at 15:53
@TimSch the image phpinfo() is in the post, thanks
– Abraham Morales
Nov 26 '18 at 15:58
Okay.. that's really strange. It's not really a solution but some workaround. Try to use cURL instead like mentioned here: stackoverflow.com/questions/12294124/…
– TimSch
Nov 26 '18 at 16:01
Please try @simonecosci command. It took a while to get what he meant but he's absolutely correct.
– TimSch
Nov 26 '18 at 16:06
|
show 4 more comments
When work the jobs say:
ErrorException: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php:33 Stack trace:
0 [internal function]: IlluminateFoundationBootstrapHandleExceptions->handleError(2, 'file_get_conten...', '/home/mmicube/p...', 33, Array)
1 /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php(33): file_get_contents('https://api.the...')
and more...
But if I try in a page (out of jobs) the file_get_contents() is fine. Why?
I configured the PHP ea-php70:
allow_url_fopen = On
allow_url_include = On
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 32M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 2M
zlib.output_compression = Off
I try with http and https and nothing... don't work.
I using Centos7.5 with cPanel, ea-php70.
phpinfo():

laravel php-7
When work the jobs say:
ErrorException: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php:33 Stack trace:
0 [internal function]: IlluminateFoundationBootstrapHandleExceptions->handleError(2, 'file_get_conten...', '/home/mmicube/p...', 33, Array)
1 /home/mmicube/public_html/app/Jobs/ProcesarPeliculas.php(33): file_get_contents('https://api.the...')
and more...
But if I try in a page (out of jobs) the file_get_contents() is fine. Why?
I configured the PHP ea-php70:
allow_url_fopen = On
allow_url_include = On
display_errors = Off
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 32M
post_max_size = 8M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php72"
upload_max_filesize = 2M
zlib.output_compression = Off
I try with http and https and nothing... don't work.
I using Centos7.5 with cPanel, ea-php70.
phpinfo():

laravel php-7
laravel php-7
edited Nov 26 '18 at 16:41
thisiskelvin
1,302414
1,302414
asked Nov 26 '18 at 15:48
Abraham MoralesAbraham Morales
5210
5210
Please do aphpinfo()from inside a laravel view to see the actual config. Maybe the config used by that vhost is not the same as the one you opened. This is likely no laravel issue but simply a configuration issue.
– TimSch
Nov 26 '18 at 15:51
1
Different php.ini for web and cli ... try `php -r 'echo ini_get("allow_url_fopen");'
– simonecosci
Nov 26 '18 at 15:53
@TimSch the image phpinfo() is in the post, thanks
– Abraham Morales
Nov 26 '18 at 15:58
Okay.. that's really strange. It's not really a solution but some workaround. Try to use cURL instead like mentioned here: stackoverflow.com/questions/12294124/…
– TimSch
Nov 26 '18 at 16:01
Please try @simonecosci command. It took a while to get what he meant but he's absolutely correct.
– TimSch
Nov 26 '18 at 16:06
|
show 4 more comments
Please do aphpinfo()from inside a laravel view to see the actual config. Maybe the config used by that vhost is not the same as the one you opened. This is likely no laravel issue but simply a configuration issue.
– TimSch
Nov 26 '18 at 15:51
1
Different php.ini for web and cli ... try `php -r 'echo ini_get("allow_url_fopen");'
– simonecosci
Nov 26 '18 at 15:53
@TimSch the image phpinfo() is in the post, thanks
– Abraham Morales
Nov 26 '18 at 15:58
Okay.. that's really strange. It's not really a solution but some workaround. Try to use cURL instead like mentioned here: stackoverflow.com/questions/12294124/…
– TimSch
Nov 26 '18 at 16:01
Please try @simonecosci command. It took a while to get what he meant but he's absolutely correct.
– TimSch
Nov 26 '18 at 16:06
Please do a
phpinfo() from inside a laravel view to see the actual config. Maybe the config used by that vhost is not the same as the one you opened. This is likely no laravel issue but simply a configuration issue.– TimSch
Nov 26 '18 at 15:51
Please do a
phpinfo() from inside a laravel view to see the actual config. Maybe the config used by that vhost is not the same as the one you opened. This is likely no laravel issue but simply a configuration issue.– TimSch
Nov 26 '18 at 15:51
1
1
Different php.ini for web and cli ... try `php -r 'echo ini_get("allow_url_fopen");'
– simonecosci
Nov 26 '18 at 15:53
Different php.ini for web and cli ... try `php -r 'echo ini_get("allow_url_fopen");'
– simonecosci
Nov 26 '18 at 15:53
@TimSch the image phpinfo() is in the post, thanks
– Abraham Morales
Nov 26 '18 at 15:58
@TimSch the image phpinfo() is in the post, thanks
– Abraham Morales
Nov 26 '18 at 15:58
Okay.. that's really strange. It's not really a solution but some workaround. Try to use cURL instead like mentioned here: stackoverflow.com/questions/12294124/…
– TimSch
Nov 26 '18 at 16:01
Okay.. that's really strange. It's not really a solution but some workaround. Try to use cURL instead like mentioned here: stackoverflow.com/questions/12294124/…
– TimSch
Nov 26 '18 at 16:01
Please try @simonecosci command. It took a while to get what he meant but he's absolutely correct.
– TimSch
Nov 26 '18 at 16:06
Please try @simonecosci command. It took a while to get what he meant but he's absolutely correct.
– TimSch
Nov 26 '18 at 16:06
|
show 4 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f53484681%2ferror-file-get-contents-in-laravel-in-jobs%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f53484681%2ferror-file-get-contents-in-laravel-in-jobs%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
Please do a
phpinfo()from inside a laravel view to see the actual config. Maybe the config used by that vhost is not the same as the one you opened. This is likely no laravel issue but simply a configuration issue.– TimSch
Nov 26 '18 at 15:51
1
Different php.ini for web and cli ... try `php -r 'echo ini_get("allow_url_fopen");'
– simonecosci
Nov 26 '18 at 15:53
@TimSch the image phpinfo() is in the post, thanks
– Abraham Morales
Nov 26 '18 at 15:58
Okay.. that's really strange. It's not really a solution but some workaround. Try to use cURL instead like mentioned here: stackoverflow.com/questions/12294124/…
– TimSch
Nov 26 '18 at 16:01
Please try @simonecosci command. It took a while to get what he meant but he's absolutely correct.
– TimSch
Nov 26 '18 at 16:06