login
wed posted: Wed 2022-05-18 16:24:14 tags: n/a
TIL PHP from version 5.4 onward embeds a simple web server. It's not intended for commercial use, but it's good enough for small demo and development purposes. Thanks to XAMPP, installing a production-grade web server is not exactly rocket science so I'm not sure why you'd defer proof of server-readyness.

DivPusher: HT run Laravel on XAMPP

Following those directions, I installed Composer and used it to install Laravel. Then in my htdocs folder I made a new subfolder lara1, and ran
laravel new lara1

Laravel complained that "Application already exists!" and didn't add anything to the subfolder. So I deleted \lara1 and reran it.

It took a minute or so but the Laravel new project configurator initialized a new project there. Added a vhosts entry to Apache\conf\extras\httpd-vhosts (or whatever it's called) and a spiffy windows\system32\drivers\etc\hosts entry to map a test domain name to localhost, and pow!, browsing to that domain proves Laravel put something in the project's \public folder.

* * *

While it's certainly handy to know how to map a hostname to an Apache virtual host, this doesn't exactly showcase anything amazing about Laravel.