The dev tutorial is broken

I’m following https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html

After cloning the repo from github, what to do next is very confusing. It conflicts with the documentation from here: https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html

Is there any advice from people who have made this work?

Thanks,
Robbie

Hi Robbie,

how does it conflict?

cc @skjnldsv for the tutorial repo

The tutorial relies on PHP’s built-in webserver, and the devenv guide is basically a full install with Apache. The tutorial leaves out some key steps that are hard to backfill from the other guide.

I finally muddled through it when I realized the web interface would create the initial config.php file, and that I would have to set up a database user for the setup wizard to use.

Well, I thought I had figured it out. But the link to my app just redirects back to the dashboard page :confused:
http://localhost:8080/index.php/apps/yourappid/
And yes, I’m putting in my app ID.
There is nothing useful in the PHP -S output or in the debug log.
Thoughts on how to proceed?

Either the all is not installed and enabled or there is simply no route configured for that URL

The app shows in the app list, and I was able to enable it. It is one of the apps generated from the Nextcloud main site. There is a route:

return [
    'routes' => [
           ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
           ['name' => 'page#do_echo', 'url' => '/echo', 'verb' => 'POST'],

It does not show in the top bar, either. And I tried to add logging to the / url controller, but get nothing in the log.

The app will only show in the navigation if a navigation entry is registered: https://docs.nextcloud.com/server/stable/developer_manual/app_development/init.html#adding-a-navigation-entry

Thank you for continuing to try to help!

What I finally found is that the tutorial suggestion to use php -S just doesn’t work. When I set up a dev environment with Apache and dropped the same app into the apps directory under /var/www/nextcloud, it worked*.

I’m just to need to this ecosystem to understand what went wrong. I tried to follow the tutorial as faithfully as possible. It just seems like something has “drifted” from the time it was written.

* I also had to update the skeleton app’s info.xml to accept newer versions of Nextcloud. The most recently available to download was v15! Notably changing that didn’t fix the problems with PHP’s built-in server.