odan / slim4-skeleton

A Slim 4 Skeleton
https://odan.github.io/slim4-skeleton/
MIT License
439 stars 80 forks source link

Forbidden #33

Closed devtkn closed 3 years ago

devtkn commented 3 years ago

Hello Odan,

I am new to slim and this skeleton project. I tried to install this skeleton on my MacBook on a local Apache Web Server. Before I installed the skeleton I ensured that I could access php and html files from the server.

I put my skeleton under a /bp subdir.

Now, when I enter http://localhost/bp I get the errormessage: "Forbidden" from the server. Where can I start to look what went wrong with my installation?

Thank you!

odan commented 3 years ago

Hi @devtkn You could check the apache error logfile. I think the location depends on the OS version. It should be somewhere located in:

You could also find the location for 'CustomLog' and 'ErrorLog' in your Apache configuration files, which are under /etc/apache2/httpd.conf

devtkn commented 3 years ago

Thanks for your hint. I checked those files and changed adjusted the httpd.conf file. No I get the following error-messages from slim, when I enter /localhost/bp:

500 Internal Server Error - Error details: [0] Webpack manifest file not exists. in 
/Library/WebServer/Documents/bp/templates/home/home.twig on line 4. 
Backtrace: #0 /Library/WebServer/Documents/bp/vendor/twig/twig/src/Parser.php(182): 
Fullpipe\TwigWebpackExtension\TokenParser\EntryTokenParserCss->parse(Object(Twig\Token)) #1 
...
odan commented 3 years ago

This is because the file public/assets/manifest.json doesn't exists.

Have you installed the skeleton according to the documentation with this command?

composer create-project odan/slim4-skeleton my-app

If you don't have a public/assets directory then run this manually:

npm install

and

npm run build
devtkn commented 3 years ago

There was no /public/assets folder after the installation. I installed with:

php composer.phar create-project odan/slim4-skeleton bp.

Now after npm install and npm audit fix i got

found 19 vulnerabilities (16 low, 2 moderate, 1 high) runnpm audit fixto fix them, ornpm audit` for details thomas@Thomass-MBP bp % npm audit fix updated 1 package in 9.668s

30 packages are looking for funding

run npm fund for details

fixed 15 of 19 vulnerabilities in 1022 scanned packages 3 vulnerabilities required manual review and could not be updated 1 package update for 1 vulnerability involved breaking changes (use npm audit fix --force to install breaking changes; or refer to npm audit for steps to fix these manually)`

I ran npm audit fix --force and finally npm run build. Now I have the /bp/public/assets with manifest.json.

And now everything works fine.

Thank you very much for your help!!!

Tom