Forum

[SOLVED] API give a...
 
Notifications
Retirer tout

[SOLVED] API give a 500 error

3 Posts
2 Utilisateurs
0 Reactions
2,222 Vu
(@antoine1003)
Posts: 36
Trusted Member
Début du sujet
 
[#6525]

Hey,
I need to use the API to retrieve some global parameters from a js custom file. I tried to put your sample code in a php file :

    $fullUrl="localhost/ipmp_new/api/Parameter/list/all"; 
    $curl = curl_init($fullUrl);
    curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($curl, CURLOPT_USERPWD, "projeqtor:projeqtor");
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    $curl_response = curl_exec($curl);
    echo $curl_response;
    curl_close($curl);

But this give me a HTTP 500 error and I don't see any log in the project log file :'(

Do you have any idea why?


 
Posté : 26/02/2020 5:27 pm
(@antoine1003)
Posts: 36
Trusted Member
Début du sujet
 

I found the proble the link to the htpasswd wasn't good


 
Posté : 26/02/2020 6:49 pm
(@babynus)
Posts: 14952
Membre Admin
 

I thin you'll find explanation in apache error log file.
Most common issue is that .htpassword is not correctly defined (it is not by default to avoid security issue)


 
Posté : 01/03/2020 11:38 pm
Share:
Retour en haut