I made a site with cakephp 4.2 and when I see the source of that site is referencing bad the css and js scripts because it adds me a folder that shouldn’t be there, this is the image with the site source:
I’m sorry I reopened this topic.
I’m still having problem with the reference, how should I configure .htaccess so that it references correctly the css and script files?
I tried to put the whole path to the app (RewriteBase /web/sistemas/programas_asignaturas/) but it still doesn’t references correctly these files.
Well, the cssBaseUrl there looks like it should. And following the flow through the HTML helper css file, it looks pretty straight-forward that it should be using this. Do you have some custom HTML helper in place? Or a custom URL helper? Or middleware that adjusts the output before returning it? If you have xdebug, put a breakpoint in HtmlHelper::css, then step through and into other functions to trace what’s going on. If you don’t have xdebug, get it, and do this. And if for some reason you can’t, then I guess simulate it with a bunch of debug or log statements in that function and the ones it calls (UrlHelper::css, and so on). The great thing about PHP is it’s all interpreted, the code is all there. Nothing at all stopping you from making edits to the core code to debug things, just as long as you put it all back how you found it when you’re done!
I installed xdebug and visual studio code, but for some reason I can’t open it, this is in fedora 31, I didn"t configure anything, can you help me with that please?
There is a special Debug Tab on the left side in VSCode.
If you got the XDebug Extension for VSCode installed you then need to enable listening for XDebug connections.
You will definitely find lots of tutorials when you google that.
Thank you, but it doesn’t open visual studio code, I execute code from the Linux console and it doesn’t do anything, let me clarify that I am connected by scp to the server with putty
Well I expected you are working in a local version of your app. XDebuging a live/remote server is a bit more complicated which i will not step through with you.
You will have to add logging/var_dump or whatever you like to debug it further.
How to get xdebug working in your environment is definitely outside the scope of a CakePHP site. There’s lots of details about how to get it working out there on dedicated sites. Learning how to run and use it is not just helpful for this one thing, it’s great for debugging any issue you may run into.