I'm trying to play around with the cpanel liveapi for perl and I'm running into a problem with making any connection to cpsrvd to use the api. I'm just trying to run the test perl and php scripts that are provided by cpanel and the both seem to fail. As the shell output below indicates, this is all being run from /usr/local/cpanel/base/frontend/x3. This would I think appear to be a server related issue, but I'm not really sure what is broken or disabled that prevents this from running.
These are the errors I get when trying to run the perl and php scripts from shell:
root@cpaneldev [/usr/local/cpanel/base/frontend/x3]# php test.live.php
Fatal error: Uncaught exception 'RuntimeException' with message 'There was a problem fetching the env variablecontaining the path to the socket' in /usr/local/cpanel/php/cpanel.php:140
#0 /usr/local/cpanel/base/frontend/x3/test.live.php(8): CPANEL->__construct()
thrown in /usr/local/cpanel/php/cpanel.php on line 140
root@cpaneldev [/usr/local/cpanel/base/frontend/x3]# perl test.live.pl
Wed Jun 20 19:58:16 2012 There was a problem connecting back to the cPanel engine [socket file does not exist or env not set].. Make sure your script ends with .live.pl or .LiveAPI:
Can't call method "exec" on an undefined value at test.live.pl line 15.
I also checked and cpsrvd is also running on the server when I made these attempts:
root@cpaneldev [/usr/local/cpanel/base/frontend/x3]# ps aux | grep cpsrvd
root 23709 0.0 0.4 15920 8580 ? S Jun19 0:00 cpsrvd (SSL) - waiting for connections
root 28504 0.0 0.0 3100 720 pts/2 R+ 20:00 0:00 grep cpsrvd