I installed CakePHP in a subdirectory on the server, specifically in html/project/cakephp_project. When I tried to move the cakephp_project directly into the html folder, I encountered issues where the CSS, JS, and controllers could not be accessed, resulting in server errors.
Should I create a new CakePHP project directly in the html directory and migrate the old project code, or is there a way to resolve this issue with the existing project?
I think there is nothing wrong with my scripts and CSS links
not only the scripts and CSS files but also all controllers can’t load in URL, I created a new controller that only shows print text but shows an error server
Did you checked that browser/page is trying to resolve which CSS, JS URLs? You can check it by inspecting network activity when page is loading.
Another option is to check logs of the server (apache).
In 3.x which I am familiar with, you don’t point to webroot at you apache configuration but to main app directory. htaccess files did the job to hide php files from direct downloading and make webroot avalible for every one.
Also check “paths” in old cake it was separated file in new it is in config: https://book.cakephp.org/5/en/development/configuration.html#general-configuration
There are settings which folder is where.