Hello friends,
Today i am bring with the new installation of Laravel 5.0 on xampp server and also many of you are facing the problem of removing the public/index.php file from the url in Laravel 5.0
There are Various steps you have to follow to install the laravel on your system.
Step - 1:- Firstly You have to install the Composer on your system from https://getcomposer.org/
Step-2 :- After This you have to open the command prompt in your system and copy the command in your command prompt as shown below
Screenshort-1
After few Seconds you can see your command prompt installing the Laravel files from online url as shown below.
Screenshort-2
After installing the laravel you can go to the xammp folder under htdocs where you can find the folder with the name laravel which you have recently install. You can see the file structure of laravel as given in the screenshort given below.
Screeshort After installing laravel.
Now when we open our Browser with the url as http://localhost/laravel/public/index.php the browser will seen like this.
Browser will show you the window like this
when we install the laravel in xampp server
As you can see in the browser url it show the public and index.php now I am going to tell you how to remove the public and index.php.
You can create the folder name Local in the laravel folder and move all the files except public folder inside the local folder as shown in the Screenshort below.
here you can create the folder name local and
move all the files inside it without public folder as shown below.
In the Screen short you can see that i have move all the files inside the local folder
Now our next step to move the files from the public folder to the root of the laravel as shown below.
Here we can move all the files present in the public folder to the outside as shown above. but again now we can have to make the change the index.php file as shown in the above screenshort.
Now we can edit some code in the index.php file which you file in the root folder as in the screenshort given above now when you
Screenshort of the index.php file in the root folder
Here you can see the two line of code there are
require __DIR__.'/../bootstrap/autoload.php
$app= require_once __DIR__.'/../bootstrap/app.php';
replace these two files with the lines of code give below.
require __DIR__.'/local/bootstrap/autoload.php
$app= require_once __DIR__.'/local/bootstrap/app.php';
You can add the local folder name as shown above after that when you run you laravel in the browser you can see the welcome page like this.
Screenshort of Welcome page of Laravel
Now you can see the url in the Browser you have successfully remove the public/index.php file from the laravel file.
If you still find the problem you can view the video related to installation of laravel on xammp server and also how you can remove the public/index.php file from the laravel url









No comments:
Post a Comment