The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/usr/local/cpanel/php/cpanel.php error

Discussion in 'cPanel Developers' started by bsolano, Oct 11, 2008.

  1. bsolano

    bsolano Registered

    Joined:
    Oct 11, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi.

    I am getting this error:

    Warning: fsockopen() [function.fsockopen]: unable to connect to unix://:-1 (Connection refused) in /usr/local/cpanel/php/cpanel.php on line 39
    There was a problem connecting back to the cpanel engine. Make sure your script is ends with .live.php or .livephp Domain name:

    What I see is that PHP is unable to read a environment variable that has the name of a Unix socket, therefore it can not open the socket...

    Do you how to fix this... maybe I could write to environment the variable by myself before including /usr/local/cpanel/php/cpanel.php.

    Any thoughts?

    Regards,

    B.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. bsolano

    bsolano Registered

    Joined:
    Oct 11, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Already been there...

    I am trying to use the PHP API as in here:

    http://www.cpanel.net/conference/08/files/APIs.pdf

    It seems that there is a Unix socket that does not exists or an environment variable that isn't there.

    I am trying to use that because I would like to create my own administration interface. I am customer of Site5. I've bought a reseller plan. I also bought a certificate for my domain. But I can not use it on the :2083 :2087 :2096 interfaces of Cpanel (only for my website). I have asked Customer Service to enable that feature following this instructions: http://www.cpanel.net/support/docs/11/whm/service_config_man_cert.html. However they said they can't because they would have to enable SSL for all (as you can see in the step 3 of Only One SSL Certificate Can Be Installed Per Service). That just sucks because I can not offer a secure channel to my customers with my own domain name.

    That's why I decided to create my own interface using a CMS. That and the fact that the X3 has the worst usability I ever seen. RVSkinLight is better but is not easy to brand. I do not see how to change stylesheets for instance. Anyway, if I can not use my own certificate for that, therefore I do not care about default interfaces.

    Since that PHP API is not working right now... I am creating a PHP library that lets you communicate indirectly with Cpanel using this: http://www.cpanel.net/docs/seminar07/XML_API.pdf. However with that I must use a TCP socket, but Unix sockets have more performance... (By the way this is not working with API2, as you can see in another thread I posted, I get a timeout or something error).

    Best regards,

    B.
     
  4. karel_wolfs

    karel_wolfs Member

    Joined:
    Mar 20, 2005
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    same error here

    I get the same error here

    Warning: fsockopen() [function.fsockopen]: unable to connect to unix://:-1 (Connection refused) in /usr/local/cpanel/php/cpanel.php on line 39
    There was a problem connecting back to the cpanel engine. Make sure your script is ends with .live.php or .livephp

    Is this a bug?
     
  5. RSimoes

    RSimoes Member
    PartnerNOC

    Joined:
    Oct 9, 2008
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Austin, TX
    Might that be the problem?
     
    #5 RSimoes, Oct 17, 2008
    Last edited: Oct 17, 2008
  6. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    In order to use the live php functionality, the pages must be served by cpsrvd. You'll need to place the .livephp or .live.php files in /usr/local/cpanel/base/frontend/$themename in order to access the APIs. Sorry for any confusion, I'll have the README updated for future releases.
     
Loading...

Share This Page