- 1 year ago
Create virtual host for Laravel using Xampp with the port 8003
To create a virtual host for Laravel using XAMPP with the port 8003, follow these steps:
Update Apache Configuration:
Open the
httpd-vhosts.conf
file located in theapache\conf\extra
directory of your XAMPP installation.Add the following virtual host configuration:
apache<VirtualHost *:8003>
DocumentRoot "C:/xampp/htdocs/laravel/public"
ServerName laravel.localhost
</VirtualHost>
Make sure to replace
"C:/xampp/htdocs/laravel"
with the path to your Laravel project directory.Update Hosts File:
Open the
hosts
file on your computer. On Windows, it is located atC:\Windows\System32\drivers\etc\hosts
.Add the following entry:
127.0.0.1 laravel.localhost
This entry associates the
laravel.localhost
domain with your local IP address (127.0.0.1).Restart Apache:
Save the changes to both the
httpd-vhosts.conf
file and thehosts
file.Open the XAMPP Control Panel, and click the "Stop" button next to Apache. Then, click the "Start" button to restart Apache with the updated configuration.
Verify the Virtual Host:
Open your web browser and navigate to
http://laravel.localhost:8003
. You should see your Laravel application running.
With these steps, you have set up a virtual host for your Laravel application, and it should be accessible at http://laravel.localhost:8003
. Make sure to replace 8003
with the desired port number if you want to use a different one.