Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

If include 'https://…' stopped working after a move to HTTPS, PHP’s ordinary local-file include feature probably has not broken. That code asks PHP to fetch a remote URL, and the cause may be disabled URL inclusion, a changed PHP configuration, a redirect, or a different response from the server. For a file on the same server, use a filesystem path such as __DIR__ . '/file.php' instead.

First check what kind of include you are using

These statements look similar, but they do different things:

// Remote URL: asks PHP to fetch a web response
include 'https://www.example.com/folder/file.txt';

// Local file: reads from the server's filesystem
include __DIR__ . '/folder/file.txt';

The https:// version is a remote URL include. It depends on PHP’s URL stream support, server configuration, network access, TLS, redirects, and the response returned by the remote server. It does not mean “open a file inside my website.” The __DIR__ version means “open this file relative to the directory containing this PHP script.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If the file is on the same server, prefer the local form:

<div id=

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi