Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Can't create AFCSAccount object in php

Avatar

Level 1

I'm getting an uncaught exception with the code below and don't know why (account98 is my dev account). It's probably a silly error on my part, but I don't see it. Please help.

<?php

     require_once("afcs.php");

     $am = new AFCSAccount("https://connectnow.acrobat.com/account98");

?>

Here is the stack trace:

<b>Fatal error</b>:  Uncaught exception 'AFCSError' in /home/babblema/public_html/afcs.php:504
Stack trace:
#0 /home/babblema/public_html/afcs.php(387): AFCS-&gt;http_get('https://connect...', Array)
#1 /home/babblema/public_html/afcs.php(224): AFCSAccount-&gt;do_initialize()
#2 /home/babblema/public_html/service.php(16): AFCSAccount-&gt;__construct('https://connect...')
#3 {main}
  thrown in <b>/home/babblema/public_html/afcs.php</b> on line <b>504</b><br />

6 Replies

Avatar

Employee

Without more information I am guessing you don't have SSL enabled in your php.ini.

Check your PHP error logs (Apache error logs if you are using Apache), you should see the root cause.

If you see an error like this, that's probably the cause:

Warning: fopen( http://connectnow.acrobat.com/xxxx?mode=xml&accountonly=true&) [function.fopen]: failed to open stream: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? in /home/a9897012/public_html/cocomo.php on line 441

To enable SSL I think you need to have the "php_openssl.*" extension uncommented in your php.ini (and of course you need to have the module available)

Avatar

Level 1

Is SSL absolutely necessary? I'm using siteground.com to host my site and it's an extra charge to enable SSL. I guess I could use Apache, but that is also a bit of work to set up. 

Avatar

Employee

I don't mean your website needs to use SSL, I mean PHP needs to be configured to be able to access services on HTTPS, that requires the SSL module to be enabled.

Avatar

Level 1

Sorry I'm new to php and web programming, but I don't believe that my problem is that openssl is disabled. A phpinfo() call shows this:

OpenSSL supportenabled
OpenSSL VersionOpenSSL 0.9.8e-fips-rhel5 01 Jul 2008

Also when I go to my account and view current the versions of all the software installed on the server I see this:

OpenSSL: 0.9.8e-fips-rhel5
I'm not sure if there is anything else I need to do (like copy some library file into my public folder?). I only have 3 files in my public folder, my service.php which is where the error is, afcs.php, and the errolog file which just shows the error in my original post over and over. Any ideas? Or is there more information that I could get you that would be helpful? I'm not sure where to begin in terms of debugging this error.

Avatar

Level 2

STOP SENDING THINGS TO MMCGEEHAN, I'M TIRED OF IT

Avatar

Level 1

Don't know what you are talking about MMCGEEHAN