Installing WHMCS into CakePHP may give you an “Invalid Token” error as you try to perform tasks in the admin dashboard.

You may search online and find several discussions regarding PHP sessions which is true but not entirely. Some suggest changing the session’s name with PHP session_name('WHMCS'); in the configuration.php file. The real problem is with the rewrite base caused by CakePHP’s parent .htaccess file in the root.

So the solution is to go into the folder where you installed WHMCS where your configuration.php file lies. Let’s assume this folder is /whmcs/ . Create a new .htaccess file in there if there isn’t one already and put the following code into it:

And there you go, problem solved with WHMCS in CakePHP and the “Invalid Token” error message. Have fun!