Slim4 apache error

I’m trying to run a skeleton slim4 project with apache but none of the proposals here does work for me.

I getting either error 500 or 404 or this “options” error.
Apparently depending what I’m activating of those suggested .htaccess settings.

Really, it so annoying now tinkering since 2 whole days to get a slim skeleton project run with apache!
It’s uncredible. Never had this before.
All my other php projects are working w/o any probs with the same apache server!

How can that be?

What are the essential settings in apache.conf and “virtualhost.conf” here to get it work with slim4 ??

Appreciating any help.

What does your Apache error log say?

Doing some more investigations now led me to a solution.
I had to put these settings into my virtual host:

<Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

and i had to do:

sudo a2enmod rewrite

and restart apache.

Really, the slim-project should post this issue as a very first topic - bold and underlined and as <h1>

Would save plenty of nervs and time

I’m glad to see you got it sorted out! The Slim website and documentation are available on Github, so you may wish to create a pull request or open an issue with your suggestion.

The majority of what you have there isn’t required by Slim. It may be required for your environment in your setup, but isn’t unique to Slim. None of those three Options are required by Slim. The AllowOverride is required, and is documented here. The Order and allow directives are also not unique to Slim and would apply to any virtual host or Directory directive.

The a2enmod command isn’t something I’m familiar with but looking at the docs it appears that the command enables Apache’s mod_rewrite module, which is also in the Slim docs.

Webserver documentaion is largely outside the scope of Slim and rewriting their documentation doesn’t make sense. Slim should document anything specific to Slim, not required by any other PHP-based site.

Glad you got it working though! And if you see anything in the documentation not covered that is unique to Slim, I’m sure a PR or Issue in the website/documentation repo would be appreciated!