search
HomePHP FrameworkLaravelAnalyze the problems encountered by laravel8.X about using docker to install and integrate the local development environment according to the official website

The following column Laravel Tutorial will introduce to you the problems encountered in laravel8. Friends help!

Currently, the official website of laravel8.x recommends using docker and laravel sail packages to install laravel. My operating system is windows 10, and I encountered many problems during the installation process. If you follow the steps, the installation is like this.
1. First install docker. Of course, docker does not support windows, so you need to install an auxiliary WSL2, which is similar to installing and using linux software on windows, and also install a linux operating system, similar to ubunut. of. This is more complicated. It was already complicated enough using laravel homestead before. I think this version will be simpler, but it feels more complicated.

2. The next step is to install a Linux system from the windows store. I chose ubuntu. The process is not that complicated.

3. Install a windows terminal. If you used cmd before, problems would occur, so install a windows terminal from the windows store. Here you can choose to enter commands from the ubuntu command terminal.

4. Make sure there is WSL2 support in docker settings. Fortunately, this is good by default. There is also a choice of ubuntu as the operating system, just check it.

Finally, use the windows terminal to select ubuntu and enter the installation command:

curl -s https://laravel.build/example-app | bash

This will create an example-app laravel project in your working directory, and then cd into it to execute the command:

cd example-app
./vendor/bin/sail up

If everything goes well, just visit localhost and your laravel will be installed.
But you still need to use a mysql client to manage the database, otherwise it will be very troublesome to keep entering commands in docker.
I used the navicat client to remotely enable the local docker database permissions. Yes, you heard it right, it is to remotely manage the local database locally. Here are some good methods you can tell me.
The problem now is that every time you use the

./vendor/bin/sail up

and

curl -s https://laravel.build/example-app | bash

commands, it will take a lot of time to install this and that of Linux. I don’t know if there is a permanent solution.
I currently use Laragon, and found that it would be very convenient to create an environment with this software.

Another problem is that when there are multiple projects, it will definitely not work if they all use localhost. It is said that multiple ports need to be changed, similar to one for 80 and one for 81. Modify the port under the directory. docker configuration file.

Then if you want to change the php configuration, apache configuration and so on, you need to use the ubuntu command line to modify it. There is no intuitive interface to change it directly.

Also, it feels inconvenient to create local domain names such as laravel.test.

I hope there is a simpler way to solve these problems.                                                                                                                                         ’ ’s ’ ’s ’ ‐ to

The above is the detailed content of Analyze the problems encountered by laravel8.X about using docker to install and integrate the local development environment according to the official website. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:learnku. If there is any infringement, please contact admin@php.cn delete
Laravel's Impact: Simplifying Web DevelopmentLaravel's Impact: Simplifying Web DevelopmentApr 21, 2025 am 12:18 AM

Laravel stands out by simplifying the web development process and delivering powerful features. Its advantages include: 1) concise syntax and powerful ORM system, 2) efficient routing and authentication system, 3) rich third-party library support, allowing developers to focus on writing elegant code and improve development efficiency.

Laravel: Frontend or Backend? Clarifying the Framework's RoleLaravel: Frontend or Backend? Clarifying the Framework's RoleApr 21, 2025 am 12:17 AM

Laravelispredominantlyabackendframework,designedforserver-sidelogic,databasemanagement,andAPIdevelopment,thoughitalsosupportsfrontenddevelopmentwithBladetemplates.

Laravel vs. Python: Exploring Performance and ScalabilityLaravel vs. Python: Exploring Performance and ScalabilityApr 21, 2025 am 12:16 AM

Laravel and Python have their own advantages and disadvantages in terms of performance and scalability. Laravel improves performance through asynchronous processing and queueing systems, but due to PHP limitations, there may be bottlenecks when high concurrency is present; Python performs well with the asynchronous framework and a powerful library ecosystem, but is affected by GIL in a multi-threaded environment.

Laravel vs. Python (with Frameworks): A Comparative AnalysisLaravel vs. Python (with Frameworks): A Comparative AnalysisApr 21, 2025 am 12:15 AM

Laravel is suitable for projects that teams are familiar with PHP and require rich features, while Python frameworks depend on project requirements. 1.Laravel provides elegant syntax and rich features, suitable for projects that require rapid development and flexibility. 2. Django is suitable for complex applications because of its "battery inclusion" concept. 3.Flask is suitable for fast prototypes and small projects, providing great flexibility.

Frontend with Laravel: Exploring the PossibilitiesFrontend with Laravel: Exploring the PossibilitiesApr 20, 2025 am 12:19 AM

Laravel can be used for front-end development. 1) Use the Blade template engine to generate HTML. 2) Integrate Vite to manage front-end resources. 3) Build SPA, PWA or static website. 4) Combine routing, middleware and EloquentORM to create a complete web application.

PHP and Laravel: Building Server-Side ApplicationsPHP and Laravel: Building Server-Side ApplicationsApr 20, 2025 am 12:17 AM

PHP and Laravel can be used to build efficient server-side applications. 1.PHP is an open source scripting language suitable for web development. 2.Laravel provides routing, controller, EloquentORM, Blade template engine and other functions to simplify development. 3. Improve application performance and security through caching, code optimization and security measures. 4. Test and deployment strategies to ensure stable operation of applications.

Laravel vs. Python: The Learning Curves and Ease of UseLaravel vs. Python: The Learning Curves and Ease of UseApr 20, 2025 am 12:17 AM

Laravel and Python have their own advantages and disadvantages in terms of learning curve and ease of use. Laravel is suitable for rapid development of web applications. The learning curve is relatively flat, but it takes time to master advanced functions. Python's grammar is concise and the learning curve is flat, but dynamic type systems need to be cautious.

Laravel's Strengths: Backend DevelopmentLaravel's Strengths: Backend DevelopmentApr 20, 2025 am 12:16 AM

Laravel's advantages in back-end development include: 1) elegant syntax and EloquentORM simplify the development process; 2) rich ecosystem and active community support; 3) improved development efficiency and code quality. Laravel's design allows developers to develop more efficiently and improve code quality through its powerful features and tools.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools