![]() DocumentRoot "C:/xampp/htdocs/ProjectName/public" DirectoryIndex index.php ServerName laraapp.test Options Indexes MultiViews FollowSymLinks AllowOverride All Require all granted To do this, write the following lines at the end of the ‘nf’ file. We’re going to configure our virtual host such that it’ll listen to the port 127.0.0.2 and pull our application. Browse through ‘C:\\xampp\htdocs\apache\conf\extra’ and open ‘nf’ file with your preferred code editor. To configure virtual host, first, we’ll need to configure the VirtualHost of Xampp. For versions like 7.0, we’ll have to write- composer create-project -prefer-dist laravel/laravel:^7.0 ProjectName Configuration of Virtual Host: This will create a laravel application with version 5.7. composer create-project -prefer-dist laravel/laravel ProjectName "5.7.*" To do this, we’ll have to write the following lines in ‘Command Prompt’ afterwards. Now we need to create our own Laravel application. This will change our current directory to ‘C:\\xampp\htdocs’ folder. ![]() In this application, write ‘cmd’ and hit ‘Enter.’ This will open a Command Prompt. Or we may simply click on ‘Start Menu’ and search for ‘Run’. We may browse to the folder with Windows Explorer. To access our laravel app through Xampp, we’ll need to create our application in the ‘xampp\htdocs’ folder. We will set the settings for ‘All User’ when setting up Composer. Remember to install Composer globally which means while installing, we’ll let all users to access Composer globally. For windows, we can simply download Composer and run the installer. Composer will work as our package or dependency manager for PHP. ![]() For default settings, it’ll create a directory like ‘C:\\xampp\’. After the completion of download, run the installer. It’ll serve our environment for PHP with Apache Server. Install Xampp and Composerįirst, we need to install Xampp. And every time, you’ll need to write the following code to serve the application.īut what if we can always access our application by writing the address like ‘ laraapp.test’ of our application in our browser’s address bar? In this article, we’re going to follow through the process to create a virtual host for our application and access it through our web browser. If you’re a newbie in Laravel like me, you probably already set up a laravel app with composer. Configure Virtual Host for Laravel in Xampp on Windows
0 Comments
Leave a Reply. |