Local development with xampp, now upload to webspace?

In the past with Cakephp 1.3 and ifI remember correctly also 3.x, I developed locally with xampp and just uploaded all the files to my webspace, adjusted the database config, and the application was running.

Now I am getting an internal server error. Do I need to check my settings perhaps with my webspace provider, or is my approach completely wrong and you just can’t upload your files in Cakephp 4.x??

how about running ‘composer install’ on the server as well? just like when u installed cake locally

I only have a webspace, no server.

sorry, i was deploying with git thus /vendor folder was not included by default, thats why i have to install it again.

error 500 is it? i would start with the server logs (the log message should be more descriptive than Internal Server Error)

how bout tmp/ folder permission? any way you can alter that?

I have looked deeper into it.

  1. I have used oven to install cakephp4 on my webspace. No error messages
  2. I have uploaded the folders src and templates from a version of my project directly after bake to the webspace -> no error messages
    Scaffolding of my database is visible.
  3. I have uploaded the folder vendor/cakephp/authentication to the webspace -> no error messages
  4. I have uploaded the files src/Application.php, src/Controller/AppController.php, src/Controller/UsersController.php, templates/Users/login.php and src/Model/Entity/User.php from a version of my project directly after implementing authentication -> internal server error.

-> When installing authentication using composer, is there anything else composer does, that I am missing when just uploading the folder authentication??

-> Does authentication have further system requirements that my webspace is missing and that only show up, when I try to use authentication?

-> Do you know any further tests that I can do to find out, what is causing my problems?

Sounds like you’re just uploading bits and pieces of things and hoping it’ll work. That’s going to fail for sure. Composer, at the very least, also updates its autoload files, which tell the system where to find your various namespaces. Without that, guaranteed errors. There’s also quite a good possibility that composer will be installing dependencies of packages. To deploy, you should have a fully functional local copy of the site, and upload the entire thing. Every single file and folder has a purpose.

To deploy, you should have a fully functional local copy of the site, and upload the entire thing.

This is what I started with and got the error message “server error”. This was my first question: Should this generally work (it did with cakephp 1.3) or does cakephp4 always need composer?

As it did not work, I tried to have everything except “authentication” installed by “oven” and then manually only upload the controller and template files (the files that I edited by hand during development of my code). Works as long as I am not trying to add authentication.

Did you look at what was causing the initial error? Just trying different things because what you have isn’t working is not an efficient way of attacking problems. :slight_smile: The problem with the original version might have been as simple as a permission problem or database access issue, both easily resolved once you know what the details are.

Did you look at what was causing the initial error?

Well this is what I am trying to do.

Just trying different things because what you have isn’t working is not an efficient way of attacking problems. :slight_smile:

going as far back to a working version and then starting to alter one thing at a time has been a good way for me in the past. And this is what I am trying here.

The problem with the original version might have been as simple as a permission problem or database access issue, both easily resolved once you know what the details are.

Any ideas how to figure that out? I only get a “internal server error”, blank logfiles. The webhosting-provider also tells me, he does not see a specific error message.

It would really help me, if someone could answer this question: Should it work to upload a complete cakephp folder generated by composer using xampp to a webspace? It did work for me for cakephp1.3
I get the impression, it does not work in cakephp4. I have also tried with a version of my project that was not yet using authentication and it also did not work, whereas the same version created by oven directly on the webspace did function.

On the bottom line: Does this mean cakephp can not be used unless you have command line access to your server / webspace.

I’ve never used any version of Cake with hosting that doesn’t allow shell access, so I can’t answer that for you.

Blank log files, though, sounds like maybe a permissions issue on the log files or folder. Also, for debugging, you should enable the debug setting in config/app.php, then details of any errors should be reported to the browser instead of a generic message.

If you want to start from a known working point and add one thing, you’d need to do that on both dev and production, and when “the authentication plugin” is the one thing you’re adding, you need to be sure to upload everything that changed when you added that. Not just that one vendor folder, but any others that it added as dependencies, changes to autoload files, etc.

I finally found one error message, telling me that the ftp client did not upload one file (how that?). I added that and now at least the start page and the login page is showing. When I try to login, I get the error message
“AH01909: RSA certificate configured for MYDOMAIN.de:443 does NOT include an ID which matches the server name”

This was always the case. I also kept the default home.ctp that shows if folders are writable, database accessible etc. when I get an internal server error, this page also does not show up.

I uploaded the whole complete folder (the one containing “bin”, “log”, “config”, “src” and so on). Are you claiming that this should work?? I am still looking for a definitive answer on that. I am getting the impression, that it does not work that way, because also when I uploaded the whole folder of a version without authentication (working locally on xampp) I get the “internal server error” when I upload it to my webspace.

Thank you for your support and patience with me!

Crazy desperate idea … oven.php somehow uses composer. Can I do a probably dirty edit of the oven.php script to include authentication into the installation? I already had a look at it, but I do not understand the oven.php script.

Don’t ask me why, but it is working now. I uploaded the whole folder again - perhaps there had been files that were not completely uploaded - and now it is running. I am both glad and a bit disappointed, because I do not like these kind of errors, where I do not know what happend.

Glad it’s working, and now you know that a straight upload is fine. :slight_smile: I’ve had FTP issues in the past too, it’s not quite as reliable as we’d expect it to be when sending thousands of small files. Just part of why I refuse to have anything to do with a server that doesn’t give me shell access. When you make updates, you’ll need to re-upload the whole thing (including remembering to separately remove any files that you might have renamed or otherwise deleted), instead of just logging in and saying “git pull”. It’s a nightmare for maintainability.