Hello,
I have been trying to use the api for some time, but I cant' get past this error:
{"error":"invalid API query", "message":""user 'projeqtor' unknown in database""}
The php file used to make the request:
<?php
$fullUrl="http://MYSERVER/projeqtor/api/Project/all";
$curl = curl_init($fullUrl);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "projeqtor:PASSWORD");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$curl_response = curl_exec($curl);
echo $curl_response;
curl_close($curl);
?>
The .htaccess file located in WEBROOT/projeqtor/api/ :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1
</IfModule>
Here's an extract from projeqtor parameters.php file:
[code]
<?php
$paramDbType='mysql';
$paramDbHost='127.0.0.1';
$paramDbPort='3306';
$paramDbUser='projeqtor';
$paramDbPassword='PASSWORD';
$paramDbName='projeqtor';
AuthUserFile WEBROOT/projeqtor/api/.htpasswd
AuthName "ProjeQtOr"
AuthType Basic
Require user projeqtor
[/code]
So far I have checked:
- that the .htaccess file is correctly used by apache
- that projeqtor exists as a user in mariadb and has all required privileges on the database
- that the database was up and running
- that the modules auth_basic and rewrite were installed and enabled
- that the .htpasswd was where it needed to be with the right infos in it (generated via htpasswd command)
I am running out of ideas and would really appreciate if someone could figure out what is wrong.