On Windows 7 cmd I have run composer create-project laravel/laravel blog --prefer-dist
from `C:\xampp\htdocs\lara. Everything is downloaded and installed fine.
However, when I try to access http://localhost/lara/blog
it shows the directory listing of apache. I followed the instruction in the documentation during the installation.
I noticed the following notes:
C:\xampp\htdocs\lara\blog
does not has any index.php or .htaccessC:\xampp\htdocs\lara\blog\app
also, does not has any index.php or .htaccesshttp://localhost/lara/blog/public
opens a page with the laravel logo and the words "You have arrived"I could not able to know what's the problem?
At first, you should install XAMPP on your computer. To install different versions of Laravel, the PHP version of your XAMPP program is very important. If you have a lower version of PHP, you should upgrade it. Laravel needs the Composer program to manage its extensions.
Laravel is a PHP-based web application framework, it provides tools for building powerful and robust applications, it is an open-source framework, which provides a structure that saves a lot of time to build and plan for large applications.
PHP 8.0. Laravel 9.x requires a minimum PHP version of 8.0.
Laravel's folder structure uses the public
folder as the WWW root, effectively placing all your application's files outside of the web root to help keep them secure. What you are experiencing is normal.
You'll have to either access your application from the http://localhost/lara/blog/public
URL, or set up a virtual host URL (e.g. http://testblog.dev
) that is pointed to the public folder. I do not develop on Windows/XAMPP so I cannot specifically tell you how to do that part.
If you're running php > 5.4 you can serve the app using the builtin server from command prompt as well (for development purposes):
php artisan serve
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With