Yum Install gcc gcc-c++
Yum Install Lrzsz
TAR-ZXVF apr-1.5.0.tar.gz
TAR-ZXVF libtool-2.2.4.tar.gz
TAR-ZXVF apr-util-1.5.3.tar.gz
CD apr-1.5.0
./configure--PREFIX=/USR/LOCAL/APR
Make
Make install
CD libtool-2.2.4
./configure--prefix=/usr/local/libtool
Make
Make install
CD apr-util-1.5.3./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr/bin/apr-1-config
Make
Make install
TAR-ZXVF pcre-8.33.tar.gz
TAR-ZXVF httpd-2.4.7.tar.gz
CD pcre-8.33
./configure--prefix=/usr/local/pcre
Make
Make install
CD httpd-2.4.7
./configure--prefix=/usr/local/apache--enable-so--enable-dav--enable-dav-fs--enable-mnaintainet-mode--with-apr =/USR/LOCAL/APR--with-apr-util=/usr/local/apr-util--with-pcre=/usr/local/pcre
Make
Make install
Cd/usr/local/apache/bin/.apachectl restart
Configuration file (for the most basic configuration)
Edit/usr/local/apache2/conf/httpd.conf File
Found it:
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
Add in the following:
AddType application/x-httpd-php. PHP (enables Apcche to support PHP)
AddType Application/x-httpd-php-source. php5
Found it:
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
Add to:
<ifmodule dir_module>
DirectoryIndex index.html index.php
</IfModule>
Found it:
#servername www.example.com:80
Modified to:
ServerName 127.0.0.1:80 or ServerName localhost:80
Remember to remove the "#" from the front.
Test
Enter http://127.0.0.1 in the browser
If there is an IT works! description is successful.
Turn off SELinux
Vi/etc/selinux/config
#SELINUX =enforcing # comment out
#SELINUXTYPE =targeted #注释掉
Selinux=disabled #增加
: wq! #保存退出
Setenforce 0 #使配置立即生效
Download package
1. Download MySQL
Http://cdn.mysql.com/archives/mysql-5.6/mysql-5.6.21.tar.gz
2. Download PHP
Http://cn2.php.net/distributions/php-5.6.3.tar.gz
3, download pcre (support Nginx pseudo-static)
Ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz
4. Download CMake (MySQL compilation tool)
Http://wwwNaNake.org/files/v3.0/cmake-3.0.2.tar.gz
5. Download libmcrypt (PHP extension)
Http://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
6. Download yasm (PHP extension)
Http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
7, T1lib (PHP extension)
Ftp://sunsite.unc.edu/pub/Linux/libs/graphics/t1lib-5.1.2.tar.gz
8. Download GD Library installation package
Https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0.tar.gz
9, LIBVPX (GD library required)
https://webm.googlecode.com/files/libvpx-v1.3.0.tar.bz2
10, TIFF (GD library required)
Http://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz
11, libpng (GD library required)
Ftp://ftp.simplesystems.org/pub/png/src/libpng16/libpng-1.6.15.tar.gz
12, FreeType (GD library required)
Http://ring.u-toyama.ac.jp/archives/graphics/freetype/freetype2/freetype-2.5.4.tar.gz
13, JPEGSRC (GD library required)
Http://www.ijg.org/files/jpegsrc.v9a.tar.gz
install the compilation tools and library files (using Yum command installation)
Yum install-y apr* autoconf automake bison bzip2 bzip2* cloog-ppl compat* cpp Curl Curl-devel fontconfig Fontconfig-devel FreeType freetype* freetype-devel gcc gcc-c++ gtk+-devel gd gettext gettext-devel glibc kernel kernel-headers keyutils ke Yutils-libs-devel krb5-devel libcom_err-devel libpng libpng* libpng-devel libjpeg* libsepol-devel libselinux-devel Libstdc++-devel libtool* libgomp libxml2 libxml2-devel libxpm* libx* libtiff libtiff* make MPFR ncurses* ntp OpenSSL nasm nasm* openssl-devel Patch pcre-devel perl php-common php-gd policycoreutils ppl telnet t1lib t1lib* wget zlib-devel
Installing CMake
Tar zxvf cmake-3.0.2.tar.gz
CD cmake-3.0.2
./configure
Make
Make install
Uninstalling older versions
use the following command to check if the installation has MySQL Server
Rpm-qa | grep MySQL
Some words are unloaded by the following command
rpm-e MySQL// Normal Delete mode
rpm-e--nodeps mysql// Brute Force Delete mode, if you use the above command to delete, prompting for other dependent files, then use this command can be strongly deleted
Yum-y install make gcc-c++ cmake bison-devel ncurses-devel
Tar zxvf mysql-5.6.21.tar.gz
CD mysql-5.6.21
CMake \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/usr/local/mysql/data \
-DSYSCONFDIR=/ETC \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_readline=1 \
-dmysql_unix_addr=/var/lib/mysql/mysql.sock \
-dmysql_tcp_port=3306 \
-denabled_local_infile=1 \
-dwith_partition_storage_engine=1 \
-dextra_charsets=all \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
Make && make install
Set permissions
use the following command to see if there are MySQL Users and user groups
cat/etc/passwd View the list of users
Cat/etc/group View the list of user groups
If not, create
Groupadd MySQL
useradd-g MySQL MySQL
Modify /usr/local/mysql Permissions
Chown-r MYSQL:MYSQL/USR/LOCAL/MYSQ
Initialize configuration
Cd/usr/local/mysql
scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--user=mysql
Start MySQL
Add services, Copy service scripts to INIT.D directory, and set boot boot
CP Support-files/mysql.server/etc/init.d/mysql
Chkconfig MySQL on
Service MySQL Start
Configure users
MySQL after successful startup, Root default no password, we need to set Root password.
before setting, we need to set the PATH , or you cannot call directly MySQL
Modify /etc/profile file, added at the end of the file
Path=/usr/local/mysql/bin: $PATH
Export PATH
Close the file, run the following command, and let the configuration take effect immediately
Source/etc/profile
execute the following command to modify Root Password
Mysql-uroot
mysql> SET PASSWORD = PASSWORD (' 123456 ');
to set Root users can remotely access, execute
Mysql> GRANT All privileges on * * to ' root ' @ ' 172.16.% ' identified by 'password' with GRANT OPTION;
Red. Password for remote access, Root the user's password can be different from the local.
Iv. Installation of PHP
1, Installation Yasm
Tar zxvf yasm-1.3.0.tar.gz
CD yasm-1.3.0
./configure
Make
Make install
2, Installation Libmcrypt
Tar zxvf libmcrypt-2.5.8.tar.gz
CD libmcrypt-2.5.8
./configure
Make
Make install
3, Installation LIBVPX
Tar xvf libvpx-v1.3.0.tar.bz2
CD libvpx-v1.3.0
./configure--PREFIX=/USR/LOCAL/LIBVPX--enable-shared--ENABLE-VP9
Make
Make install
4. Installing TIFF
Tar zxvf tiff-4.0.3.tar.gz
CD tiff-4.0.3
./configure--prefix=/usr/local/tiff--enable-shared
Make
Make install
5, installation Libpng
Cd/usr/local/src
Tar zxvf libpng-1.6.15.tar.gz
CD libpng-1.6.15
./configure--prefix=/usr/local/libpng--enable-shared
Make
Make install
6, Installation FreeType
Tar zxvf freetype-2.5.4.tar.gz
CD freetype-2.5.4
./configure--prefix=/usr/local/freetype--enable-shared
Make #编译
Make install #安装
7. Install JPEG
Tar zxvf jpegsrc.v9a.tar.gz
CD jpeg-9a
./configure--prefix=/usr/local/jpeg--enable-shared
Make #编译
Make install #安装
8, installation LIBGD
Tar zxvf libgd-2.1.0.tar.gz #解压
CD libgd-2.1.0 #进入目录
./configure--PREFIX=/USR/LOCAL/LIBGD--enable-shared--with-jpeg=/usr/local/jpeg--with-png=/usr/local/libpng-- With-freetype=/usr/local/freetype--with-fontconfig=/usr/local/freetype--with-xpm=/usr/--with-tiff=/usr/local/ TIFF--with-vpx=/usr/local/libvpx #配置
Make #编译
Make install #安装
9, installation T1lib
Cd/usr/local/src
Tar zxvf t1lib-5.1.2.tar.gz
CD t1lib-5.1.2
./configure--prefix=/usr/local/t1lib--enable-shared
Make Without_doc
Make install
Ten , install PHP
Note: If the system is 64-bit, please execute the following two commands, otherwise the installation of PHP will be wrong (32-bit system does not need to do)
\cp-frp/usr/lib64/libltdl.so*/usr/lib/
\cp-frp/usr/lib64/libxpm.so*/usr/lib/
Cd/usr/local/src
TAR-ZVXF php-5.6.3.tar.gz
CD php-5.6.3
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs- -with-mysql=/usr/local/mysql--with-mysqli=/usr/local/mysql/bin/mysql_config
5 , compiling
Make
6. Test compilation
Make Test
7. Installation
Make install
8. Configuration Files
Cp/usr/local/src/php-5.3.16/php.ini-development/usr/local/php/lib/php.ini
Copy the original php.ini-development in the source code to/usr/local/php/lib/php.ini, and rename it to PHP.ini
9. Restart Apache
10. Testing
Create a PHP file test.php under Apache Htdocs, with the following contents:
<?php
Phpinfo ();
?>
Then enter http://127.0.0.1/test.php in the browser.
If a PHP-related configuration is present, the successful
Run Yum Install libxml2 , and then run Yum Install Libxml2-devel installation
This article is from the "sword896.blog.163.com.." Blog, make sure to keep this source http://456958.blog.51cto.com/446958/1672591
CentOS 6.5 Compile and install apache2.4.12+mysql5.6.21+php5.6.3