How to get PHP file_get_contents() to work with HTTPS?

Spread the love

Sometimes, we want to get PHP file_get_contents() to work with HTTPS.

In this article, we’ll look at how to get PHP file_get_contents() to work with HTTPS.

How to get PHP file_get_contents() to work with HTTPS?

To get PHP file_get_contents() to work with HTTPS, we need to change a few settings in php.ini.

We need to enable the php_openssl extension.

And we need to set allow_url_fopen to on.

For instance, we add

extension=php_openssl.dll

allow_url_fopen = On

in php.ini to enable the php_openssl extension and set allow_url_fopen to on.

Conclusion

To get PHP file_get_contents() to work with HTTPS, we need to change a few settings in php.ini.

We need to enable the php_openssl extension.

And we need to set allow_url_fopen to on.

Leave a Reply

Your email address will not be published.