Ubuntu Linux under the source code compilation installation Lamp Environment

Source: Internet
Author: User

    1. Installing the Zlib Library

      TAR-ZVXF zlib-1.2.8.tar.gz

      CD zlib-1.2.8

      ./configure

      Make && make install

2. Installing apache2.4.23

TAR-ZVXF httpd-2.4.23.tar.gz

CD httpd-2.2.23

./configure--PREFIX=/USR/LOCAL/HTTP2 \

--enable-modules=all \//support dynamic, static load module

--enable-rewrite \ #支持重写

--enable-mods-shared=all \

--enable-so #让apache核心装载dso

# #出错 ERR:APR not found//missing APR Library

Then install Apr

TAR-ZVXF apr-1.5.2.tar.gz

CD apr-1.5.2

./configure--PREFIX=/USR/LOCAL/APR

# #出错 Err:cannot Remove "Libtoolt": No such Fileor directory

The solution is to install Libtool

sudo apt-get install Libtool

Recompile install APR

Make && make install

Apr installed successfully


Recompile install Apache



# #又出错

Apr-uitl not found

With the APR of the same mistake

Installing Apr-util

TAR-ZVXF apr-util-1.5.4.tar.gz

CD apr-util-1.5.4

./configure--prefix=/usr/local/apr-util

Make && make install

After you continue to recompile Apache

# #错误, still not found Apr-util

Workaround: Add--with-apr-util=/usr/local/apr-util after the Apache./configure Compile command


Continue compiling and installing Apache

Error: Pcre not found

Installing Pcre

TAR-ZVXF pcre-8.3.8.tar.gz

./configure

Make && make install



Continue compiling and installing Apache

No error, installation successful

Launch Apache

Cd/usr/local/http2/bin

./apachectl Start


# #报错

Error while loading shared Librarles:libpcre.so1:cannot open Shared object file:no such file or drectory

Workaround

See if libpcre.so.1 exists in the system

Find/-name "Libpcre.so.1"

found that the file exists in the/usr/local/lib directory

Run the ldconfig command

The purpose of the Ldconfig command is to search for a shareable dynamic-link library (in the form of lib*.so*) in the default search directory (/lib and/usr/lib) and in the directory listed in the dynamic library configuration file/etc/ld.so.conf. This creates the connection and cache files required by the dynamic loader (ld.so). The cache file defaults to/etc/ld.so.cache, which holds a list of queued dynamic-link library names.  

The Run IDD httpd command displays the httpd dependency, and if the file directory is displayed, the load succeeds

Start Apache again successfully



Installing LIBXML2

TAR-ZXVF libxml2-2.9.3.tar.gz

CD libxml2-2.9.3

./configure--PREFIX=/USR/LOCAL/LIBXML2

Make && make install


Installing Jpeg8


TAR-ZXVF jpegsrc.v8b.tar.gz

CD jpeg-8b

./configure--prefix=/usr/local/jpeg--enable-share--enable-static

Make && make install


Installing libpng

TAR-ZVXF libpng-1.6.24

./configure

Make && make install


Installing FreeType

TAR-ZXVF FreeType

CD freetype-2.6.5

./configure--prefix=/usr/local/freetype

Make && make install


Installing the GD Library

TAR-ZVXF gd-2.035.tar.gz

CD gd-2.035

./configure--prefix=/usr/local/gd--with-jpeg=/usr/local/jpeg--with-png--with-zlib--wit-freetype=/usr/local/ FreeType

Hint version is low, need to be greater than 2.10

To change the version, reinstall it as per the above steps


Installing PHP5

TAR-ZVXF php-5.6.24

CD php-5.6.24

./configure--prefix=/usr/local/php \

--WITH-APX2=/USR/LOCAL/HTTP2/BIN/APAXS \

--WITH-MYSQL=MYSQLND \

--WITH-MYSQLI=MYSQLND \

--WITH-PDO-MYSQL=MYSQLND \

--with-freetype-dir=/usr/local/freetype \

--WITH-GD=/USR/LOCAL/GD \

--with-zlib--WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2 \

--with-jpeg-dir=/usr/local/jpeg \

--with-png-dir \

--enable-mbstring=all \

--enable-mbregex \

--enable-shared


Make && make install

# #错误X11/xpm.h No such file or directory reason, the GD library does not support XPM


Solve

Download Ibxpm-dev file for Deb type, click Install, and recompile install GD


Recompile the installation again Php,ok

CP Php.ini-development/usr/local/php/lib/php.ini//Copy PHP config file



Configure Apache to support PHP


Vi/usr/local/http2/conf/httpd.conf

Let Apache support PHP, add the following code

AddType application/x-httpd-php. php


<ifmodule dir_module>

DirectoryIndex index.html

<IfModule>

In front of index.html, plus index.php.




Ubuntu Linux under the source code compilation installation Lamp Environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.