PHP: failed to open stream: Invalid argument

Keerati Pongram
<?php
$file = file_get_contents('https://s3.amazonaws.com/cloudplus/us-east-1%3A4eddd3f9-3729-473f-984c-16fddfe5e23f/Contacts/Contacts_1436328498.vcf');
?>

I don't know why is show error like this [function.file-get-contents]: failed to open stream: Invalid argument

Cyclonecode

Make sure so that you have allow_url_fopen enabled in your php.ini file.

To edit your php.ini file an check if allow_url_fopen is enabled you could check the output of phpInfo() to find the location of your php.ini file and then open this file in a text editor and search for allow_url_fopen and make sure so this is set to On.

To find the location of your php.ini file you could do like this from the terminal:

php -r 'phpInfo();' | grep php.ini

When you have located the file you can edit it using a text editor like nano for instance:

sudo nano /etc/private/php.ini

After you have modified your configuration file make sure so you restart apache using:

sudo apachectl restart

You may also check if there is any suitable wrappers for https:

$wrappers = stream_get_wrappers();
echo 'openssl: ',  extension_loaded  ('openssl') ? 'yes':'no', "\n";
echo 'https wrapper: ', in_array('https', $wrappers) ? 'yes':'no', "\n";
echo 'wrappers: ', var_dump($wrappers);

If no https wrapper is enabled and you're running windows you should again edit your php.ini file and uncomment this line:

;extension=php_openssl.dll

Just like before, you need to restart your server for the changes to take effect.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

PHP file_put_contents Failed to open stream, invalid argument

From Dev

failed to open stream: Invalid argument with exclamation marks in URL

From Dev

PHP error failed to open stream/failed opening

From Dev

PHP error failed to open stream/failed opening

From Dev

Android- Saving File (Input & Output Stream) throws Exception (open failed: EINVAL (Invalid argument)) in Pre-lollipop devices

From Dev

Something.php failed to open stream - yii

From Java

PHP - Failed to open stream : No such file or directory

From Dev

PHP - readfile() failed to open stream: Permission denied

From Dev

PHP: "failed to open stream: Permission denied"

From Dev

PHP - fopen(): Failed to Open Stream on uploaded file

From Dev

PHP - fopen: failed to open stream: Permission denied

From Dev

failed to open stream and permission denied - PHP

From Dev

PHP, WAMP - failed to open stream: HTTP wrapper

From Dev

PHP - failed to open stream: No such file or directory in

From Dev

PHP - readfile() failed to open stream: Permission denied

From Dev

PHP - fopen(): Failed to Open Stream on uploaded file

From Dev

PHP - failed to open stream error for uploaded image

From Dev

PHP/SQL - failed to open stream: No such file or directory

From Dev

Assist with diagnosing PHP include, failed to open stream

From Dev

git svn rebase index file open failed : Invalid argument

From Dev

git svn rebase index file open failed : Invalid argument

From Dev

PHP failed to open stream: Too many open files

From Dev

swapoff failed: Invalid argument

From Dev

failed to open stream - XAMPP

From Dev

failed to open stream

From Dev

failed to open stream

From Dev

Laravel classloader.php error failed to open stream: No such file or directory

From Java

require(vendor/autoload.php): failed to open stream

From Dev

autoload.php issue: failed to open stream: no such file or directory

Related Related

  1. 1

    PHP file_put_contents Failed to open stream, invalid argument

  2. 2

    failed to open stream: Invalid argument with exclamation marks in URL

  3. 3

    PHP error failed to open stream/failed opening

  4. 4

    PHP error failed to open stream/failed opening

  5. 5

    Android- Saving File (Input & Output Stream) throws Exception (open failed: EINVAL (Invalid argument)) in Pre-lollipop devices

  6. 6

    Something.php failed to open stream - yii

  7. 7

    PHP - Failed to open stream : No such file or directory

  8. 8

    PHP - readfile() failed to open stream: Permission denied

  9. 9

    PHP: "failed to open stream: Permission denied"

  10. 10

    PHP - fopen(): Failed to Open Stream on uploaded file

  11. 11

    PHP - fopen: failed to open stream: Permission denied

  12. 12

    failed to open stream and permission denied - PHP

  13. 13

    PHP, WAMP - failed to open stream: HTTP wrapper

  14. 14

    PHP - failed to open stream: No such file or directory in

  15. 15

    PHP - readfile() failed to open stream: Permission denied

  16. 16

    PHP - fopen(): Failed to Open Stream on uploaded file

  17. 17

    PHP - failed to open stream error for uploaded image

  18. 18

    PHP/SQL - failed to open stream: No such file or directory

  19. 19

    Assist with diagnosing PHP include, failed to open stream

  20. 20

    git svn rebase index file open failed : Invalid argument

  21. 21

    git svn rebase index file open failed : Invalid argument

  22. 22

    PHP failed to open stream: Too many open files

  23. 23

    swapoff failed: Invalid argument

  24. 24

    failed to open stream - XAMPP

  25. 25

    failed to open stream

  26. 26

    failed to open stream

  27. 27

    Laravel classloader.php error failed to open stream: No such file or directory

  28. 28

    require(vendor/autoload.php): failed to open stream

  29. 29

    autoload.php issue: failed to open stream: no such file or directory

HotTag

Archive