Web server and PHP¶
Web server and PHP¶
What methods did we used to run web pages on our browser ?¶
- Simply open a file on the browser
- Github pages
- Built-in web server in PHP
php -S localhost:8080
Live server¶
Launch a local development server with live reload feature for static & dynamic pages.
What is a web server ?¶
A web server is a computer that have:
- a software that can answer to HTTP requests (HTTP server) and ;
- files to be displayed.
Problems with the built-in web server ?¶
- Only for development
- Too much logs
- No security
- Bad efficiency
What are the alternative ?¶
- Apache
- LAMP (Linux, Apache, MySQL, PHP)
- XAMP (MySQL+PHP+PHPMyAdmin)
- Nginx
Is it easy to use ?¶
You can install XAMPP! on your computer, but if you work with a team or lose your computer you have to install all of it.
What can be the solution ?
La containerisation c'est bien.
Vincent Guidoux, everyday.
Xampp container¶
Xampp container¶
What should I remember?¶
- What is a web server
- Why I should not use the built-in web server in PHP
Can I still use the built-in web server in PHP ?¶
Yes, but only for development.
And yes, you can use it for the practical work 2, just be sure to document it in the README.md.