Linux Source code compilation

Source: Internet
Author: User
Tags gpg php script

First, lamp compilation

linux+apache+mysql+php

PHP can be found by Appchae to parse PHP script, to operate the database through PHP

1. Installing the GCC compiler

How to compile the source code C language under Linux

View Memory Free

View hard Disk Fdisk-l

View Mount Status Df-h

Compile process: build configuration file, compile, install

In the Software installation package. h file is the C-language function library

To install Appache httpd as an example: go to the package, use:./configure--prefix=/usr/local/httpd2_name Define the configuration file-installation path,

Make starts compiling

Make install to start installation

2. Install the Appache package

Check if the system has the lamp environment installed

Rpm-qa|grep httpd

Rpm-qa|grep MySQL

Rpm-qa|grep PHP

Uninstall httpd/mysql/php that have been uninstalled

Yum Remove htpd

Yum Remove MySQL

Yum Remove PHP

Delete the installation directory directly when the source code package is deleted

3. Lamp Installation

Download password for package: Zdov

Installation

libxml2-2.6.30

Tar-xvzf Libxml2-2.6.30.tar

CD libxml2-2.6.30

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

Make

Make install

Complete the installation

libmcrypt-2.5.8

Tar-xvzf Libmcrypt-2.5.8.tar

CD libmcrypt-2.5.8

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

Make

Make install

Complete the installation

If an error is encountered: Error:c++ compiler cannot create executables

Cause Analysis: The components are not fully installed

Workaround: Yum install gcc gcc-c++ gcc-g77

Note: My yum source is

Name=rhl-medi
Baseurl=file:///media #挂载了光盘
Enabled=1
Gpgcheck=0
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release

Install Libledl in the Libmcrypt source directory

CD Libmcrypt-2.5.8/libltdl

./configure--enable-ltdl-install

Make

Make install

Installing zlib-1.2.3

CD zlib-1.2.3

./configure

Make

Make install

Installing libpng

CD libpng-1.2.31/

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

Make

Make install

Will error: MAKE[1]: * * * [libpng12.la] Error 1

Problem: Operating System

Resolution:

CD zlib-1.2.3//Enter the Zlib directory
Cflags= "-o3-fpic"./configure
Make
Make install
Come out again and install libpng

Installing JPEG6

Mkdir/usr/local/jpeg6

Mkdir/usr/local/jpeg6/bin

Mkdir/usr/local/jpeg6/lib

Mkdir/usr/local/jpeg6/include

Mkdir-p/usr/local/jpeg6/man/man1

cd/jpeg-6b

./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-static

Make

Make install

If error:./libtool--mode=compile gcc-o2-i.-C./JCAPIMIN.C * * * [Jcapimin.lo] Error 127

Issue: Libtool Toolkit Obsolete

WORKAROUND: New decompression Libtool Toolkit , source installation

Unzip Libtool242.zip

CD Libtool

./configure

Make

Make install

CD jpeg-6b/


Perform the installation Jpeg6 again
./configure --prefix=/usr/local/jpeg6/

Make install

7, installation FreeType

CD freetype-2.3.5/

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

Make

Make install

8, installation autoconf

cd/autoconf/

./configure

Make

Make install

9. Installing GD

Mkdir/usr/local/gd2

CD gd-2.0.35

VI gd_png.c

Write:

Replace #include "png.h" with #include "/usr/local/libpng/include/png.h"

./configure--prefix=/usr/local/gd2/--with-jpeg=/usr/local/jpeg6/--with-freetype=/usr/local/freetype/--with-png =/usr/local/libpng/

Make

Make install

Third, the next installation Appache

Linux Source code compilation

Related Article

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.