Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Larave with a virtual machine

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to install Larave with a virtual machine". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to install Larave with a virtual machine".

This article mainly focuses on the following aspects: installing composer, installing laravel, configuring php-fpm self-starting configuration, nginx self-starting, the implementation environment of this article, centos 7.3, all operations are simulated in the virtual machine. 1. Install composer

Execute instruction curl-sS https://getcomposer.org/installer | php

Move php composer.phar to mv composer.phar / usr/local/bin/composer in the bin directory and rename it to composer

Enter the instruction to check the version to see if the installation is successful

Second, install laravel

Note that you need to install the version of the requirements for PHP click here is to use PHP7.2laravel is ready to operate in the virtual machine, there is no separate configuration of conf, directly in the html directory operation

Execute to install composer create-project-- prefer-dist laravel/laravel blog "5.8.*" to check the version of laravle

III. Access testing

Find out the ip address of my virtual machine and then access the http://192.168.254.135/blog/public/index.php through the host

Fourth, fault tolerance

What is operated locally will not be affected, nor will it be affected by the online server.

In the same environment as Kaka, because it is a virtual machine, php-fpm may not restart after shutdown. The following error will occur. Do not panic when you encounter this error. Check whether your php-fpm is enabled.

Just execute the command systemctl start php-fpm

5. Set fpm self-startup

Kaka's PHP is installed directly using yum.

To set up fpm automatic startup, you only need to execute systemctl enable php-fpm.

6. Set ngixn self-startup

Adjust according to my nginx installation location, my installation location is / usr/local/nginx/

Execute cd / lib/systemd/system/

Create a vim nginx.service and write as follows

[Unit]

Description=nginx service

After=network.target

[Service]

Type=forking

ExecStart=/usr/local/nginx/sbin/nginx

ExecReload=/usr/local/nginx/sbin/nginx-s reload

ExecStop=/usr/local/nginx/sbin/nginx-s quit

PrivateTmp=true

[Install]

WantedBy=multi-user.target

Set self-boot systemctl enable nginx

Thank you for reading, the above is the content of "how to install Larave with a virtual machine". After the study of this article, I believe you have a deeper understanding of how to install Larave with a virtual machine, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report