I want to easily and smoothly see phpinfo displayed on my page, did not think of the installation environment all the way error, non-stop Google toss a half-day finally saw the phpinfo. The problems encountered in this summary, to provide you with a reference.
My OS is Ubuntu 9.10, thanks to Apt-get's powerful features for a reference to this article http://wiki.ubuntu.org.cn/index.php?title=Apache&variant=zh-cn#. E5. Ae.89.e8.a3.85lamp, easy to complete the construction of lamp.
To hand itch not, the environment all deleted the reuse source package to build again. The steps are as follows:
(Logon with a non-root account and run in sudo when Root is required)
First, the installation of build-essential
# Bulid-essential is the compilation tool needed to compile the source package (c/s + + program)
# Ubuntu under Default is not installed, Ubuntu can perform sudo apt-get install build-essential
Install package build-essential_11.4.tar.gz
# installation Command
TAR-ZXVF build-essential_11.4.tar.gz
CD build-essential-11.4
./configure
Make
sudo make install
Make clean
Second, the installation of MySQL
Step.1
Installation of ncurses
# if missing ncurses package MySQL compilation will report no Curses/termcap library found error
Install package ncurses-5.6.tar.gz
TAR-ZXVF ncurses-5.6.tar.gz
CD ncurses-5.6
./configure--prefix=/usr/local/ncurses--with-shared--without-debug--enable-widec
Make
sudo make install
Make clean
Step.2
installation of MySQL
Install package mysql-5.1.42.tar.gz
Step.a
# installation Command
TAR-ZXVF mysql-5.1.42.tar.gz
CD mysql-5.1.42
./configure--prefix=/usr/local/mysql--with-named-curses-libs=/usr/local/ncurses/lib/libncursesw.so.5.6-- With-charset=gbk
#--prefix=/usr/local/mysql MySQL Installation path
# Description of MySQL configuration file path: MySQL search my.cnf in the following order
#/etc,mysql installation directory such as/USR/LOCAL/MYSQL/ETC, the installation directory of the data directory such as/usr/local/mysql/data, whichever is first found. The configuration of my.cnf under/ETC is global settings
#--with-named-curses-libs=/usr/local/ncurses/lib/libncursesw.so.5.6 ncurses library File installation path
#--localstatedir=/usr/local/mysql/var database Default store path (you can set other paths such as,/var/lib/mysql)
#--WITH-CHARSET=GBK settings Database support Chinese character set
Make
sudo make install
Step.b
# copy MySQL config file to target directory/usr/local/mysql/etc
# New/USR/LOCAL/MYSQL/ETC directory (this directory is not created automatically)
sudo mkdir/usr/local/mysql/etc
sudo cp support-files/my-medium.cnf/usr/local/mysql/etc/my.cnf
# Delete the temporary files generated by the installation (be sure to execute after the configuration file is copied, or my-medium.cnf will be deleted)
Make clean
Step.c
# Add a Linux system group named MySQL (refer to the MySQL manual 2.8.1. Source Installation Overview)
sudo groupadd MySQL
# Create a new Linux system user named MySQL and add it to the MySQL system group
# If Linux only starts the command-line interface, you can add the required accounts with the following actions
# sudo useradd-m-s/bin/false-g mysql MySQL
#-M This option does not create a user directory
#-S Specifies the shell,/bin/false used by the new user to indicate that the user cannot log on to the system
#-G MySQL adds user MySQL to group MySQL
# I'm using the desktop system, add an account with the command as above. When the system starts, the login interface will display the MySQL user although it does not log in
# Use the following command, the MySQL account will not be displayed in the login interface
sudo useradd-r-s/bin/false-g mysql MySQL
#-R establishes system account without creating user directory, user assigned UID less than 1000
Step.d
# Create MySQL Authorization form
# If you run the command with root, you should use the--user option. The value of the option should be the same as the login account you created in Stpe.czz. If you use this user login to run the command, you can omit the--user option
sudo/usr/local/mysql/bin/mysql_install_db--user=mysql
Step.e
# access to MySQL installation directory (/usr/local/mysql)
Cd/usr/local/mysql
# change all properties of file to root
sudo chown-r root.
# Change all properties of the data directory to the MySQL user (that is, the user created in step.c)
sudo chown-r mysql var
# Change group properties to MySQL Group
sudo chgrp-r MySQL.
Step.f
# Start MySQL Service
Sudo/usr/local/mysql/bin/mysqld_safe--user=mysql &
# Log in to the database
/usr/local/mysql/bin/mysql-uroot
MySQL Setup is complete.
Three, the installation of Apache
# Use DSO dynamic compilation, about dynamic compilation and static compilation of the difference can refer to http://www.ha97.com/2612.html
Install package httpd-2.2.14.tar.gz
TAR-ZVXF httpd-2.2.14.tar.gz
CD httpd-2.2.14
./configure--prefix=/usr/local/apache--enable-mods-shared=most--enable-so
#--prefix=/usr/local/apache to install Apache to the/usr/local/apache path
#--enable-mods-shared=most all standard modules are dynamically compiled into the DSO module
#--ENABLE-SO Apache Core Loader DSO, but does not actually compile any dynamic modules
Make
Make install
Make clean
# start Apache
Sudo/usr/local/apache/bin/apachectl start
# Open the browser to enter the browser will see it works!
Apache Setup is complete.
Four, the installation of PHP
Step.1
Installation of FreeType
Install package freetype-2.3.11.tar.gz
# installation Command
TAR-ZXVF freetype-2.3.11.tar.gz
CD freetype-2.3.11
./configure--prefix=/usr/local/freetype
Make
sudo make install
Make clean
Step.2
Installation of Zlib
Install package zlib-1.2.3.tar.gz
# installation Command
TAR-ZXVF zlib-1.2.3.tar.gz
CD zlib-1.2.3
./configure
Make
sudo make install
Make clean
# installation changed zlib installation directory such as/usr/local/zlib, after the libpng installation has also been successful, when it is to install the GD library has failed, forced to install the zlib to the default path, after the smooth passage
Step.3
Installation of libpng
Install package libpng-1.4.0.tar.gz
# installation Command
TAR-ZXVF libpng-1.4.0.tar.gz
CD libpng-1.4.0
./configure--prefix=/usr/local/libpng
Make
sudo make install
Make clean
# A lot of people do this. The CP scripts/makefile.std makefile replaced./configure (the distinction remains to be verified)
Step.4
installation of JPEG
Install package jpegsrc.v7.tar.gz
# installation Command
TAR-ZXVF jpegsrc.v7.tar.gz
CD jpeg-7
./configure--prefix=/usr/local/jpeg7
Make
sudo make install
Make clean
# Many people manually create a JPEG directory structure do not know whether it is because of differences or other reasons (to be verified)
# All of the above packages are required by the GD library to compose the library, the following installation of the GD library
Step.5
Installation of the GD library
Install package gd-2.0.35.tar.gz
# installation Command
Step.a
TAR-ZXVF gd-2.0.35.tar.gz
CD gd-2.0.35
./configure--prefix=/usr/local/gd2--with-freetype=/usr/local/freetype--with-png=/usr/local/libpng--with-jpeg=/ Usr/local/jpeg7
Step.b
# edit Makefile file, find around 232 lines
# See similar content cppflags =-i/usr/local/freetype/include/freetype2-i/usr/local/freetype/include-i/usr/local/freetype/ Include-i/usr/local/jpeg7/include
# modified to Cppflags =-i/usr/local/freetype/include/freetype2-i/usr/local/freetype/include-i/usr/local/freetype/include -i/usr/local/libpng/include-i/usr/local/jpeg7/include
Step.c
# Edit Gd_png.c file to find if (!png_check_sig (SIG, 8)) {/* Bad signature * *
# modified to if (png_sig_cmp (SIG, 0, 8)) {
Step.d
# Execute Command
Make
sudo make install
Make clean
# GD Library Installation Complete
Step.6
Installation of LIBXML2
# LIBXML2 used to parse XML
# installation Command
TAR-ZXVF libxml2-2.6.26.tar.gz
CD libxml2-2.6.26
./configure--prefix=/usr/local/libxml
Make
Make install
Make clean
Step.7
Installation of PHP
Install package php-5.3.1.tar.gz
# installation Command
Step.a
TAR-ZXVF php-5.3.1.tar.gz
CD Php-5.3.1.tar
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-mysql=/usr/local/mysql-- WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2--with-zlib--with-png-dir=/usr/local/libpng--with-jpeg-dir=/usr/local/jpeg7- -with-freetype-dir=/usr/local/freetype--WITH-GD=/USR/LOCAL/GD2
Make
sudo make install
Make clean
Step.b
Copy PHP configuration file
sudo cp Php.ini-development/usr/local/php/lib/php.ini
# The PHP profile name differs from this version, with two files php.ini-development in the current version (used in the development environment) php.ini-production (in the production environment)
Step.d
Modify Apache configuration file/usr/local/apache/conf/httpd.conf
# Add support for PHP
LoadModule Php5_module modules/libphp5.so
AddType application/x-httpd-php. php
Step.e
# If you log in with the root account skip this step
# More Directory web directory permissions
sudo chown-r logged-in User: Login user/usr/local/apache/htdocs
Step.f
#重启apache
Sudo/usr/local/apache/bin/apachectl restart
Okay, that's it. The Linux configuration environment is configured, due to various issues this article dragged several geniuses to finish. There's also an unsaved and lost document. The installation of each package./configure involves parameters just some basic parameters, lamp trip just started. You'll find it's not as difficult as you think, okay. Good luck!