CentOS install \ Uninstall Apache, MySQL, PHP

Source: Internet
Author: User
Tags bz2 fpm install php soap pear php source code

To install using a command:

1. Installing Apache

#yum-y Install httpd

2. Install MySQL

#yum-y install MySQL

#yum-y Install Mysql-server

#yum-y Install Mysql-devel

#chkconfig--levels 235 mysqld on//Let MySQL self-boot

3. Install PHP

#yum-y Install PHP

#yum-y Install Php-devel

/////////////////////////////////////

Compile the installation using source code:

1. Compiling Apache

1) Download Apache source code

Http://httpd.apache.org/download.cgi#apache24

2) #./configure--prefix=/usr/local/apache--with-apr=/usr/local/arp--with-apr-util=/usr/local/apr-util

Tips:

Configure:error:APR not found. Please read the document.

Download apr-1.5.2.tar.bz2:

http://apr.apache.org/download.cgi

#tar XJF apr-1.5.2.tar.bz2//Decompression bz2 format

#cd apr-1.5.2

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

#make && make Install

3) Execute again:

#./configure--prefix=/usr/local/apache--with-apr=/usr/local/arp--with-apr-util=/usr/local/apr-util

Tip: Apr-util not installed

Download apr-util-1.5.4.tar.bz2:

HTTP://APR.APACHE.ORG/DOWNLOAD.CGI//Same as above Apr address

Unzip the build:

#./configure--prefix=/usr/local/apr-util--WITH-APR=/USR/LOCAL/APR

#make && make Install

4) Execute again:

#./configure--prefix=/usr/local/apache--with-apr=/usr/local/arp--with-apr-util=/usr/local/apr-util

Tips:

Configure:error:pcre-config for Libpcre not found. PCRE is required and available from http://pcre.org/

Download Pcre:
Http://sourceforge.net/projects/pcre/postdownload?source=dlp
#unzip-O pcre-8.10.zip//If not, yum-y install unzip
#cd pcre-8.10
#./configure--prefix=/usr/local/pcre

5) execution

#./configure--prefix=/usr/local/apache2/--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util/-- With-pcre=/usr/local/pcre/

#make && make Install

Installation is complete.

6) Start the Apache server:

#/usr/local/apache2/bin/apachectl start

7) using a browser to access Http://xxx.xxx.xx.xxx will display the page.

2. Compiling PHP source code

1) Download PHP source code:

Http://php.net/get/php-5.6.10.tar.bz2/from/a/mirror

2)

#tar XJF php-5.6.10.tar.bz2//Decompression
#cd php-5.6.10
#执行

./configure
--prefix=/usr/local/php
--with-apxs2=/usr/local/apache2/bin/apxs
--with-config-file-path=/usr/local/php/etc
--with-jpeg-dir
--with-png-dir
-with-bz2
--with-freetype-dir
--with-iconv-dir
--with-zlib-dir
--enable-soap
--enable-gd-native-ttf
--enable-ftp
--enable-sockets
--enable-mbstring
--enable-exif

Error when installing PHP:
Configure:error:xml2-config not found. Please check your LIBXML2 installation.

Yum-y Install LIBXML2
The installation is still prompt, xml2-config not found. The original is libxml2-devel not installed, you can execute the following command:
Yum-y Install libxml2*
Installing libxml2-devel.x86_64 0:2.7.6-17.el6_6.1

Error 2:
Configure:error:Please Reinstall the BZIP2 distribution
Yum-y Install bzip2 Bzip-devel

If the prompt error, generally depends on the library is not found, follow the prompts to install the corresponding dependent library.

Attached: PHP Compile configure common error:
Http://blog.sina.com.cn/s/blog_75a07c3b0101kcwb.html

3) #./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache2/bin/apxs--with-config-file-path=/usr/ Local/php/etc--with-jpeg-dir--with-png-dir-with-bz2--with-freetype-dir--with-iconv-dir--with-zlib-dir-- Enable-soap--enable-gd-native-ttf--enable-ftp--enable-sockets--enable-mbstring--enable-exif

#make && make Install

Installation is complete.

///////////////////////////////////////

Unloading:

1. Uninstalling Apache

/ETC/INIT.D/HTTPD Stop//Stop httpd Service

#rpm-qa | grep httpd

Httpd-2.2.3-63.el5.centos.1

Httpd-manual-2.2.3-63.el5.centos.1

2) Uninstalling the package

Rpm-e Httpd-manual-2.2.3-63.el5.centos.1

Rpm-e System-config-httpd-1.3.3.3-1.el5

Or:

RPM-E httpd

Hint that there is a dependency:

"Error:failed dependencies:httpd >= 2.2.0 is needed by (installed) gnome-user-share-0.10-6.el5.i386"

#rpm-E Gnome-user-share

or use parameter –nodeps regardless of the dependencies between each package

#rpm-e–nodeps httpd//So you don't need to delete gnome-user-share.

2. Uninstalling PHP

1) View all PHP-related RPM packages installed on the machine

#rpm-qa | grep php

Php-cli-5.3.3-22.el6.x86_64

Php-pdo-5.3.3-22.el6.x86_64

Php-gd-5.3.3-22.el6.x86_64

Php-fpm-5.3.3-22.el6.x86_64

Php-common-5.3.3-22.el6.x86_64

Php-5.3.3-22.el6.x86_64

Php-xml-5.3.3-22.el6.x86_64

Php-pear-1.9.4-4.el6.noarch

2) Delete by dependency order

Rpm-e php-fpm-5.3.3-22.el6.x86_64

Rpm-e php-pdo-5.3.3-22.el6.x86_64

Rpm-e Php-pear-1.9.4-4.el6.noarch

Rpm-e php-cli-5.3.3-22.el6.x86_64

Rpm-e php-5.3.3-22.el6.x86_64

Rpm-e php-xml-5.3.3-22.el6.x86_64

Rpm-e php-gd-5.3.3-22.el6.x86_64

Rpm-e php-common-5.3.3-22.el6.x86_64

3. Uninstall MySQL

1) Check the system for MSYQL installed in RPM package:

#rpm-qa | Grep-i MySQL

mysql-server-5.6.17-1.el6.i686
mysql-client-5.6.17-1.el6.i686

2) Uninstall MySQL

#rpm-E mysql-server-5.6.17-1.el6.i686

#rpm-E mysql-client-5.6.17-1.el6.i686

3) Delete Msyqld service

#chkconfig--list | Grep-i MySQL

#chkconfig--del MySQL

4) Delete the distributed MySQL folder

#whereis MySQL

Or

#find/-name MySQL

MySQL:/usr/lib/mysql/usr/share/mysql

Empty all directories and files related to MySQL

#rm-rf/usr/lib/mysql

#rm-rf/usr/share/mysql

#rm-rf/usr/my.cnf

CentOS install \ Uninstall Apache, MySQL, PHP

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.