XAMPP localhost returns object not found after installing Laravel

前端 未结 6 1190
日久生厌
日久生厌 2020-12-31 07:46

After much faffing about I got laravel to work with XAMPP. However, I can\'t seem to access directories in the htdocs folder via localhost now. Attempt to access a file retu

6条回答
  •  佛祖请我去吃肉
    2020-12-31 08:17

    In your Apache's http.conf, find the DocumentRoot line and add the subdirectory /public on the end.

    Once that is done and you've restarted Apache, you'll be able to access everything which is contained within your htdocs/public folder (including subdirectories of that folder), along with any routes you've defined in Laravel.

    Laravel is designed to be set up this way as to protect the code and files by not having them in the folder which is served out to the web.

提交回复
热议问题