Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to configure LAMP environment under linux

Shulou Source: shulou.com Published: 2022-06-01 03:00:29 10月01日 Update

How to configure the LAMP environment under linux, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

How to configure the LAMP environment under linux, before learning the PHP scripting language, you must build and be familiar with the development environment, there are many kinds of development environment, such as LAMP, WAMP, MAMP and so on. Here I introduce the construction of LAMP environment, that is, Linux, Apache, MySQL, PHP environment.

1. Prepare for

Depending on the system, you may have prepared different files. I used Ubuntu Linux. I have packaged the following five files. Click on the link below to download them.

Httpd-2.2.9.tar.gz

Mysql-5.1.52.tar.gz

Php-5.3.5.tar.gz

Libxml2-2.7.7.tar.gz

Ncurses-5.6.tar.gz

Baidu network disk download: Linux lamp environment installation package

two。 Install mysql

The copy code is as follows:

Mysql groups and users need to be added before installation

/ / add a user group to get the root permission first

Trigkit4@ubuntu:~$ su root

Password:

Root@ubuntu:/home/trigkit4# groupadd mysql

Root@ubuntu:/home/trigkit4# useradd-g mysql mysql

/ / decompress the package and first enter the directory where the downloaded file is located.

$cd / home/trigkit4/Downloads tar-zxvf mysql-5.1.52.tar.gz

/ / enter the extracted folder

Root@ubuntu:/home/trigkit4/Downloads# cd mysql-5.1.52

/ / enter the directory to decompress ncurses-5.6.tar.gz

Cd / home/trigkit4/Downloads tar-zxvf ncurses-5.6.tar.gz

/ / enter the ncurse-5.6 folder again

Root@ubuntu:/home/trigkit4/Downloads/mysql-5.1.52# cd / home/trigkit4/Downloads/ncurses-5.6

/ / configure installation directory and other information

. / configure-prefix=/usr/local/ncurses-with-shared-without-debug-enable-widec

/ / compilation, which is a bit time-consuming

Root@ubuntu:/home/trigkit4/Downloads/ncurses-5.6# make

/ / install

Root@ubuntu:/home/trigkit4/Downloads/ncurses-5.6# sudo make install

3. Install Apache

The copy code is as follows:

/ / first enter the directory where httpd-2.2.9.tar.gz is located

Cd / home/trigkit4/Downloads/

/ / extract the Apache package

$tar-zxvf httpd-2.2.17.tar.gz

/ / enter the decompressed file directory

Root@ubuntu:/home/trigkit4# cd / home/trigkit4/Downloads/httpd-2.2.9

/ / configure the installation directory

Root@ubuntu:/home/trigkit4/Downloads/httpd-2.2.9#. / configure-prefix=/home/trigkit4/Downloads/apache-enable-so

/ / compile

Root@ubuntu:/home/trigkit4/Downloads/httpd-2.2.9# make

/ / install

Root@ubuntu:/home/trigkit4/Downloads/httpd-2.2.9# sudo make install

4. Install libxml2

The copy code is as follows:

/ / enter the directory where the libxml2 file is located

Root@ubuntu:/home/trigkit4# cd / home/trigkit4/Downloads

/ / extract the libxml software package

Tar-zxvf libxml2-2.7.7.tar.gz

/ / enter the decompressed file directory

Root@ubuntu:/home/trigkit4/Downloads# cd libxml2-2.7.7

/ / configuration

$. / configure

/ / compile

$make

/ / install

$sudo make install

5. Install php

The copy code is as follows:

/ / enter the directory where the php file is located and extract it

$tar-zxvf php-5.3.5.tar.gz

/ / enter the decompressed file directory

Root@ubuntu:/home/trigkit4/Downloads# cd / home/trigkit4/Downloads/php-5.3.5

/ / enter the libxml2 file directory and install libxml2

. / configure-- prefix=/usr/local/libxml2/ http://www.bbqmw.net/ configuration directory

. / configure-- with-apxs2=/opt/www/bin/apxs

This is the answer to the question about how to configure the LAMP environment under linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Tags: Files directories environment code configuration location users questions compilations different folders more preparation help development solutions easy easy information content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Tech Info OPPO Reno Shulou Technology Linux