The following code attempts to read the CPanel login page on my own server. The code fails even though the login page can be read manually in any browser. The failure message is as follows:
): failed to open stream: HTTP request failed! HTTP/1.1 401 Access Denied Still Working in C:\Web\TestHTTPS-EE.php on line 5
I am using PHP 5.1.6 and openssl is enabled. I am using Apache 2.2.3 on Windows running on my local computer as localhost.
The problem also occurs if I move this PHP file to a remote server. It also occurs if I add the username and password to the URL.
Note that other websites, even secure ones, can be read without a problem by similar coding. For example, $url="https://22.214.171.124/
I have searched the Web but cannot find a solution.
// Read and display CPanel login page
$url="http://126.96.36.199:2082/"; // Fails ("401 Access Denied Still Working")