I am migrating a CakePHP project from cPanel to the AWS Lightsail apache server. I have zipped all the files from cPanel and uploaded them on my instance. Started the apache server and hosted the project on the instance IP.
The issue is everything is working fine on the cPanel hosted website but in the AWS instance many pages are not working and the data is also not displaying from the database. Some functionalities like login and signup are also not working.
I have started all the PHP errors and also in CakePHP errors. In starting I got the permission errors but now I am not getting any errors and still, functionalities are not working. I have followed all the steps from CakePHP’s official documentation. Started the mod_rewrite but still not able to find the issue.
I have checked all the apache error logs but didn’t find any. I don’t know cakePHP much as I am only hosting the project.
I can’t tell you what is wrong, and I suspect despite your efforts to share the information there is not enough for anyone to diagnose - but what I do suggest is turning on the debugger.
Obviously doing so on a live site is rather stupid, so what you can do is lock it to your own IP only. In src/config/app_local.php (this is for Cake 4, can’t speak for the older versions but probably the same - and if there is no app_local.php then it’ll be app.php) change the assignment of the ‘debug’ array elements. This is how: -
* Debug Level:
* Production Mode:
* false: No error messages, errors, or warnings shown.
* Development Mode:
* true: Errors and warnings shown.
'debug' => filter_input(INPUT_SERVER, 'REMOTE_ADDR') === 'YOUR.WAN.IP.HERE'), //debug enabled just for me
'DebugKit.forceEnable' => filter_input(INPUT_SERVER, 'REMOTE_ADDR') === 'YOUR.WAN.IP.HERE'), //when debugging be very cautious about enabling this, its a security leak
'DebugKit.ignoreAuthorization' => true, //needed if you can't login
I hope that helps pin down what’s causing the issues.
And, clear the cache in the O.S.: bin/cake cache clear_all
If you don’t have TTY to the OS you can knock up a quick shell_exec() in PHP, then delete it immediately after use!