Rest API database connection issues with Codeigniter -


i'm using phil sturgeons rest api between server , mobile app. locally works brilliantly, on server bounces issue when using api keys authentication:

unable connect database server using provided settings.  filename: core/loader.php 

this while $config['rest_enable_keys'] = true; enabled, when change variable false api service works fine. both locally , server running same table layout , both have same api key in keys table. rest of site works fine doesn't show database connection errors.

changing line $config['rest_database_group'] = 'default'; prompts different error, lead me believe infact connecting correct database, can't establish keys table?

you have specified invalid database connection group. 

there's no difference in code between server , locally yet locally correct error message of {"status":false,"error":"invalid api key."}

could issue using multiple database connections? checked environment , seems correct wouldn't explain why work locally.

thanks lot nithin-meppurathu helped me debug core of rest library find problem.

the problem lied in multiple database connections, due switching used depending on environment being defaulting 'default' database environment. changing $config['rest_database_group'] = 'default'; environment variable able pointing correct place.


Comments

  1. I am running into same problem. Can you elaborate what you mean by setting environment variable ? What exact text value did you set ?

    It works fine when running on windows machine. On Linux server, production API key is giving issue as described.


    ReplyDelete

Post a Comment