Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to build the development environment of Nginx+HHVM+MySQL on Ubuntu system

Shulou Source: shulou.com Published: 2022-06-01 15:04:36 09月22日 Update

This article focuses on "how to build a Nginx+HHVM+MySQL development environment on the Ubuntu system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to build a Nginx+HHVM+MySQL development environment on the Ubuntu system.

It seems that recently this HHVM is particularly popular, and the main reason is probably due to the large running efficiency. After installation, the probe test is used to calculate the running time is 0.0*. It is said that it can run perfectly under 512m of memory, which greatly improves the running efficiency of the website. At present, HHVM can run normally under CentOS, Ubuntu and debian, so let's talk about the process of running HHVM+Nginx+Mysql under Ubuntu.

1. First, install Nginx and execute:

The code is as follows:

Sudo apt-get update

Sudo apt-get install-y unzip vim git-core curl wget build-essential python-software-properties

Sudo add-apt-repository-y ppa:nginx/stable

Sudo apt-get update

Sudo apt-get install-y nginx

2. At this stage, we will install HHVM. We need to add HHVM's repository to your sources.list file, and then update the software list.

Important: don't forget to replace the above DISTRIBUTION_VERSION (such as lucid, precise, trusty) or Debian's jessie or wheezy with your Ubuntu distribution code. The same is true in Linux Mint, but only petra is supported.

Once you have added the HHVM repository, you can easily install it.

The code is as follows:

# apt-get install-y hhvm

After installation, it can be started, but it does not boot up. You can boot with the following command.

The code is as follows:

# update-rc.d hhvm defaults

3. Wait for the installation to complete, and execute the following FastCGI configuration script:

The code is as follows:

Sudo / usr/share/hhvm/install_fastcgi.sh

Sudo / etc/init.d/nginx restart # restart Nginx

Sudo update-rc.d hhvm defaults # Boot start

Sudo service hhvm restart # restart hhvm

PS: if you want to use HHvm the way you want to execute the PHP command, you can execute: sudo / usr/bin/update-alternatives-install / usr/bin/php php / usr/bin/hhvm 60, so you can use commands like: php-v.

4. To install Mysql, execute the following command, and the installation process will ask you to enter your password twice:

The code is as follows:

Apt-get install mysql-server

5, add MysqL to boot, command: chkconfig add mysqld and chkconfig mysql on, (ps: if prompted to say: / sbin/insserv: No such file or directory, execute: ln-s / usr/lib/insserv/insserv / sbin/insserv, and then execute: chkconfig-levels 235 mysql on), then you can download phpmyadmin and put it in the article directory to directly manage MySQL, the default user name is root.

6. Test HHVM and Nginx/Apache

To confirm that hhvm is working, you need to create a hello.php in the document root of nginx/apache.

The code is as follows:

# nano / usr/share/nginx/html/hello.php

Add the following code to the file:

PHP Code copies content to the clipboard

Then visit the link below to make sure you can see "hello world"

Http://localhost/info.php

Or

Http://IP-Address/info.php

At this point, I believe you have a deeper understanding of "how to build a Nginx+HHVM+MySQL development environment on the Ubuntu system". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Code command run environment system development content warehouse efficiency file website process learning testing practical deeper important code interest memory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Xiaomi vpn Shulou Information OPPO Reno