Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel 4 does not work on Windows XAMPP

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:

  1. C:\xampp\htdocs\lara\blog does not has any index.php or .htaccess
  2. C:\xampp\htdocs\lara\blog\app also, does not has any index.php or .htaccess
  3. Only accessing http://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?

like image 957
SaidbakR Avatar asked Sep 07 '13 01:09

SaidbakR


People also ask

Can Laravel work with XAMPP?

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.

Can Laravel run on Windows 10?

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.

Does Laravel 8 require PHP 8?

PHP 8.0. Laravel 9.x requires a minimum PHP version of 8.0.


2 Answers

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.

like image 164
Aken Roberts Avatar answered Sep 30 '22 12:09

Aken Roberts


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

like image 40
Faramarz Salehpour Avatar answered Sep 30 '22 12:09

Faramarz Salehpour