Login   Register  
PHP Classes
elePHPant
Icontem

fsocketopen Error

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      cPanel API  >  All threads  >  fsocketopen Error  >  (Un) Subscribe thread alerts  
Subject:fsocketopen Error
Summary:I'm getting an fsocketopen Error on line 53 cPanel.php
Messages:2
Author:Ralph
Date:2008-11-28 15:54:52
Update:2008-12-02 15:36:16
 

  1. fsocketopen Error   Reply   Report abuse  
Picture of Ralph
Ralph
2008-11-28 15:54:52
Anyone know why I might be getting this error:

Warning: fsockopen() [function.fsockopen]: unable to connect to mywebiste.com:2082 (Connection timed out) in /home/mywebsite/public_html/cPanel.php on line 53
Disk Space Used: 0 MB

  2. Re: fsocketopen Error   Reply   Report abuse  
Picture of Ralph
Ralph
2008-12-02 15:36:16 - In reply to message 1 from Ralph
I found out the fix was to use "localhost" instead of my domain name because my cpanel provider's firewall was not letting me connect.

Now I can connect but my test code displays 0MB:

require_once('cPanel.php');
$cPanel = new cPanel('localhost', 'username', 'password', 2082, false);
echo 'Disk Space Used: ' . $cPanel->getSpaceUsed() . ' MB<br>';