not able to run Tutorial: “Single Post Page”

mes
Member | 8
+
0
-

I have trouble with the beginner tutorial https://doc.nette.org/…/single-post

May someone can help me out: I've did all steps in a row (twice) but here occurs an error message, I don't know how to interpret.
Following the instructions, I created the app/Presenters/PostPresenter.php
But there is a hint below the file content, I don't understand:
We have to set a correct namespaces App\Presenters for our presenter. It depends on presenter mapping.

The link to the file within the git repo shows the identical content like my config/common.neon

application:
...
	mapping:
		*: App\*Module\Presenters\*Presenter

I also implemented the new template Post/show.latte, and the link within the Homepage/default.latte File, but unfortunately I do receive the following error, when I click on the Headline to reach the second page.
The first page is rendered without issue, basically nette is working, would I say.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

I double checked the file rights, file content, server is working (.htaccess looks correct in my eyes) and so on. The /Log folder has no entry (but I have proved, it's working). Investigating other examples, the RouterFactory.php does not need to adjusted, I guess.

What do I have to do, to fix this? Which information do I have missed in my puzzle?
Thank you in advance!

Last edited by mes (2022-01-23 02:19)

nightfish
Member | 517
+
0
-

@mes Hi, the displayed error comes not from Nette application, but from Apache webserver. The issue is with the configuration of Apache (most likely .htaccess) file, not with you PHP-based application. Check the error log of Apache for more information.

mes
Member | 8
+
0
-

@nightfish Thank you!
Your hint was valuable, for me. Now. I've learned now something about PHP Error Log and then verified the .htaccess redirection.

Finally: I missed the

	RewriteBase /

was commented out.
Now everything is working as expected.

May an adjustment within the source project is helpful?
https://github.com/…ww/.htaccess#L12

David Grudl
Nette Core | 8218
+
+2
-

The RewriteBase value can be different for everyone, so it's commented out to use autodetection, which works in most cases.