My road to success / Documentation

Can say it enough, but this whole suite rocks! It rocked from day 1, for everything, but, and that’s maybe peresonal, the documentation. I had real issues finding simple stuff. Like, how do I return a response from a REST endpoint, if it was configured to be DB connected. But hey, I made it, so it’s not that horrible!

Everything was fine up until deployement on production server… And that’s why I’m posting this, because these are points I had to find for myself and lost a few hours on.

  • Generate package from admin interface wouldn’t work. The button turns to spinning, spins, spins, spins, a notification pops telling you the process has started, then nothing… No console error, no logs, just… nothing. Spent a couple of minutes to try to find where the zip file was saved… Bored of it not working, I tried from home, and it worked… Turns out something must have timed out on my old crap work computer… Technically, explaining how the process works would have saved me hours if I had known a download should trigger. I then tried from work again, without ticking “Execute composer” and in fact, I got the download 50 something seconds later.

  • Uploaded the archive to a server, ssh’ed to it, unzipped and started Insomnia (you know, that awesome free altenative to Postman) to test the endpoints: 404… What the hell… Mmmmh, took me a while to switch my brain on and point the document root to /public

  • Tested on Insomnia: 500 internal error… Mmh, PHP logs return “Uncaught error”, great… The API could return a “reason” field within the payload of the 500 if possible. The errors were, and that with a Laminas admin ui packaged zip:

    • my data/cache wasn’t existing and couldn’t be created, write permissions…
    • my config_glob_paths in application.config.php was pointing to my local environement path, something like C:%LOCALUSER%\jetbrains_ds54sdf21efr/config/autoload. I can tell you, Apache did not know what to do with it on my server. But instead of returning an error, well, I could try to add services and stuff, but they wouldn’t save and stay…
    • php composer.phar dump-autoload -o . It seems laughable, but when you’re not used to… You can forget it
    • Mysql Database and oauth PDO user/passwords were wrong… But there’s nothing stating it, so it’s a try and catch until you find it. Yeah, on local they were ok, using root and no password, but I had a typo in the production dsn and it failed miserably, without even speaking it out
  • Hey, my non /oauth path started to return 401 Not authorized! But the /oauth path were just returning a Laminas page stating a 404 for unspecified reasons… I must tell you, I tried about everything, until I decided to add a new oauth2 PDO service that worked right away…

I can’t remember if there’s more to it to be honest. This post idea is to be constructive and highlight the hiccups I had on my road, maybe to improve the “Deployement documentation” for the next users that stumble on that!

Cheers and thank you for an awesome toolset!