Issue after upgrading from php 5.4 to 5.6

Discussion in 'Troubleshooting' started by pogeybait4883, Sep 26, 2019.

  1. pogeybait4883

    pogeybait4883 New Member

    Joined:
    Sep 26, 2019
    Messages:
    2
    I'm a programmer helping a client try to fix some errors in aMember after he upgraded his server from 5.4 to 5.6. There have been several errors we're trying to fix but one in particular has me stumped.

    In /members/include/ADheader.php I am seeing on line 60 it's trying to verify the user is logged in through the API. After logging in and manually going to http://www.mydomain.com/amembercp/api/check-access/by-login?_key=XXXXXXXXXXXXXXXX&login=mylogin (data is padded to protect privacy), I can see the correct JSON data being displayed.

    However if I echo out the data returned from cURL which goes to the exact same address (verified), I am getting a web page returned as the data which says "aMember is not configured yet. Go to configuration page".

    Im stumped and am not sure what is causing this. Can someone please help me figure this out? I'm not savvy on aMember and the inner workings so this is very difficult chasing down errors inside an unfamiliar framework.
  2. pogeybait4883

    pogeybait4883 New Member

    Joined:
    Sep 26, 2019
    Messages:
    2
    I should mention that we have in fact followed that link and reconfigured aMember several times. Here is the code in ADheader.php on line 60 that is having the issue. It included my debugging lines at the end to show the content.

    $url = AMEMBER_URL.API_URL_FOR_USER_PLAN_BY_LOGIN;
    $secret_key = SECRET_KEY;
    $login = $_SESSION['amember_auth']['user']['login'];
    $qry_str = "?_key=".$secret_key."&login=".$login."";
    #echo $url . $qry_str; exit(); //this prints out a url and when browsed there, shows json data
    $ch = curl_init();
    // Set query data here with the URL
    curl_setopt($ch, CURLOPT_URL, $url . $qry_str);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, '3');
    $content = trim(curl_exec($ch));
    curl_close($ch);
    echo $content; exit(); //this shows the web page saying am isnt configured
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295

Share This Page