Error directory settings in cakephp project

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?

can you show me the URL you used?

maybe the URL is the problem

url : http://192.168.57.79:8686/

It looks normal to load the image
I use cakelte from this GitHub - arodu/cakelte: AdminLTE plugin for CakePHP

check the scripts or css links of it maybe the asset path is wrong

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

1 Like

how about the layout you used?

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.

I very much always point Apache at the webroot folder, not the main app directory.