APIlite + (https) domain/ (https) subdomain + no php.ini access

Discussion in 'Installation' started by truedi, Apr 25, 2013.

  1. truedi

    truedi New Member

    Joined:
    Apr 17, 2013
    Messages:
    4
    Hi
    I have the following setting:
    https://www.mydomain.ch -> aMember installed in /am/
    https://lib.mydomain.ch -> a subdirectory /lib/ protected by aMember

    I'm using APIlite on the page https://lib.mydomain.ch/index.html

    I've seen this article:
    http://www.amember.com/forum/threads/using-api-from-ssl-subdomain.16152/#post-62403

    My problem is:
    I don't have my own php.ini file.

    What I see is in the firefox webconsole an error "line 3 syntax error: missing ;" the line 3 is the php statement require_once (.... /am/library/Am/Lite.php).

    Any help is welcome!
    truedi
  2. truedi

    truedi New Member

    Joined:
    Apr 17, 2013
    Messages:
    4
    My web-hosting-company modified the php.ini (as an exception). I verified the php.ini with phpinfo:
    "session.cookie_domain" points to ".thomasruedi.ch" (Local Value / Master Value)

    What I'm doing in my member.php (display Login or Logged-In information in https://lib.mydomain.ch/index.html) is:
    ------------------------------------------------------------------------
    <?php
    require_once('/srv/www/vhosts/thomasruedi.ch/httpdocs/am/library/Am/Lite.php');

    if(Am_Lite::getInstance()->isLoggedIn()){
    $html = "<ul>";
    $html .= "<li>".Am_Lite::getInstance()->getName()."</li>";
    if (Am_Lite::getInstance()->haveSubscriptions(Am_Lite::getInstance()->getUsername())){
    $html .= "<li>Subscription is active</li>";
    } else {
    $html .= "<li>Subscription is inactive</li>";
    }
    ....
    ....
    print "document.write('".$html."');";
    ?>
    -------------------------------------------------------------------------
    line 3 is "require_once ..........................."

    The problem still exists.

    Best,
    truedi
  3. truedi

    truedi New Member

    Joined:
    Apr 17, 2013
    Messages:
    4
    Update:
    I've built a little test script. It shows, that the Lite API works fine.

    --------------------------------------------
    <?php
    $litepath = '(your absolute path to)/am/library/Am/Lite.php';
    require_once($litepath);
    echo $litepath;

    if(Am_Lite::getInstance()->isLoggedIn()){
    echo "<p>loggedin". "</p>";
    } else {
    echo "<p>not loggedin". "</p>";
    }

    echo "<p>getName: ".Am_Lite::getInstance()->getName(). "</p>";
    echo "<p>haveSubscriptions: ".Am_Lite::getInstance()->haveSubscriptions(). "</p>";
    echo "<p>getUsername: ".Am_Lite::getInstance()->getUsername(). "</p>";
    echo "<p>getLogoutURL: ".Am_Lite::getInstance()->getLogoutURL(). "</p>";
    echo "<p>getRootURL: ".Am_Lite::getInstance()->getRootURL(). "</p>";
    echo "<p>renderLoginForm: ".Am_Lite::getInstance()->renderLoginForm();

    ?>
    --------------------------------------------

    I will review my member.php code and post the result.
    Best,
    truedi
  4. truedi

    truedi New Member

    Joined:
    Apr 17, 2013
    Messages:
    4
    Update - all is fine now.

    Best,
    truedi

Share This Page