I'm desperately looking for support for a problem which i have been trying to solve for days.
Problem description:
About a week or two ago, i migrated my webshop to a new server.
Both the old and the new server are running on WHM/CPanel.
My webshop was running fine on the old server except for the site speed so i migrated to a new one.
Everything is working fine on the new server except the api.
When i try to request a token, i get the following message:
Code: Select all
Notice: Undefined index: key in /home/lynuxms/public_html/oc/catalog/controller/api/login.php on line 14[]
The API worked fine on the old server and the new server is almost a copy of the old (i copied the most settings) and somehow the API is not working on the new server.
I really really need the API and i was hoping someone could help me look into.
I check the following things on the server, and they seemed to be OK just like on the old server:
- htacces file (check)
- config (check)
- Php modules (check)
- Apache modules (check)
- I turned of the firewall to check if it was firewall related.
- Opencart requirements (check)
Is there anyone who can help me with this?
PROBLEM SOLVED!
I feel ashamed of my stupidity.
But i learned my lesson.
This was the problem:
The account on CPanel where the laravel project is running on is being hosted on a dedicated IP on the server.
So i whitelisted the dedicated IP in Opencart and did my POST requests.
I found out that the POST request is being sent from the server's hostname IP instead of the dedicated or the public server IP.
So after i whitelisted the hostname IP in the API credentials in Opencart, everything worked again.
I wanna thank everyone for your kind support!
I'll leave the thread open for other people in the future who encounter the same issue.