An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
May 14, 2022 04:26 pm GMT
Original Link: https://dev.to/retinqdon/setting-up-laravel-with-sql-server-and-laragon-on-windows-2cp9
Setting up Laravel with SQL Server AND Laragon on Windows
I just want to share how I connect my laravel project with sqlserver.
I assume that you already have Laragon and SQL Server in your local system.
Step 1. Download the PHP driver here
- Go to the bottom of the page then download windows-8.1.zip (since I'm using PHP 8.1
- Extract the zip file to a folder, then go to folder named x64, you will see the following dll
- Then copy these dll to your php folder inside the laragon folder, mine is C:\laragon\bin\php\php-8.1.5-nts-Win32-vs16-x64\ext
- Then Edit your php.ini, add the extension
- Then restart your laragon server
Step 2. Make a new laravel app using laragon quick app menu
- Then we need to update the .env file
DB_CONNECTION=sqlsrvDB_HOST=127.0.0.1DB_PORT=1433DB_DATABASE=lara-sqlserverDB_USERNAME= saDB_PASSWORD= 12345678
- Next, create the database in sql management studio, mine is lara-sqlserver
Before running the migration, make sure to enable tcp-ip in sql configuration manager
then run the migration
php artisan migrate
- if everything works fine you should see this in your terminal
Thanks guys!
Original Link: https://dev.to/retinqdon/setting-up-laravel-with-sql-server-and-laragon-on-windows-2cp9
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To