MS SQL Server and PHP (Apache) stack setup tutorial (Windows)

Veröffentlicht am: 27 Dezember 2023
auf dem Kanal: Jon Buder
1,027
12

In this tutorial, we go into setting up MS SQL Express edition, SQL Server Management Studio, XAMPP (just Apache and PHP), and VS code. Finally, we create configure a sample database and test run some PHP code to connect to it.

This serves as a complete web development workstation VM, DB server and web server. We use an AWS EC2 instance, but the same could easily apply to an on-premises Windows Server, or even Windows 10 or 11 desktop computer. There's nothing discussed here that strictly requires a server version of Windows, although the stability and reliability is likely to be a bit higher compared to the desktop versions.

If you use EC2, there's various considerations regarding cost. You could use instance savings plans or spot instances, etc. According to AWS's calculator today, the on-demand t2.large like I used in the tutorial would cost $90.58 per month with 30GB of EBS storage. I'd highly recommend testing a smaller instance type and using some kind of savings plan.

SQL Server downloads:
https://www.microsoft.com/en-us/sql-s...

Link to the PHP drivers for SQL Server for Windows:
https://learn.microsoft.com/en-us/sql...

XAMPP:
https://www.apachefriends.org/downloa...

Dynamic driver loading string for XAMPP php.ini:
extension=sqlsrv_82_ts_x64

Make sure you turn on SQL Server & Windows Authentication for the instance.

User: tut_user
Password: password

DB name used in video: "tutorial"

Make sure you add at least db_reader access to the "tutorial" DB for the tut_user account.

Table used: "people"
Fields:
ID - int (identity)
FirstName - varchar(50) - not null
LastName - varchar(50) - not null
FavoriteColor - varchar(50) - null

Sample PHP code for connecting to the DB, with the credentials and DB/table names used in the tutorial:
https://github.com/jonbuder/sql-serve...


Auf dieser Seite können Sie das Online-Video MS SQL Server and PHP (Apache) stack setup tutorial (Windows) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Jon Buder 27 Dezember 2023 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,027 Mal angesehen und es wurde von 12 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!