CentOS Yum Install Apache + PHP + MySQL

Source: Internet
Author: User

# Check and Uninstall

The code is as follows Copy Code
Rpm-qa|grep httpd
RPM-E httpd
Rpm-qa|grep MySQL
RPM-E MySQL
Rpm-qa|grep PHP
Rpm-e PHP

# Delete the default Apache

The code is as follows Copy Code
Yum-y Remove httpd

# Find the fastest source

The code is as follows Copy Code
Yum-y Install Yum-fastestmirror

# Update

The code is as follows Copy Code
Yum-y Update

# Install the necessary components

The code is as follows Copy Code
Yum-y Install patch make GCC gcc-c++ gcc-g77 Flex Bison file
Yum-y Install Libtool libtool-libs autoconf kernel-devel
Yum-y Install libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel
Yum-y Install FreeType freetype-devel libxml2 libxml2-devel zlib zlib-devel
Yum-y Install glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel
Yum-y Install ncurses Ncurses-devel Curl Curl-devel
Yum-y Install e2fsprogs-devel krb5 krb5-devel libidn
Yum-y install OpenSSL openssl-devel vim-minimal nano sendmail
Yum-y Install Fonts-chinese GetText gettext-devel
Yum-y Install Ncurses-devel
Yum-y Install Gmp-devel Pspell-devel
Yum-y Install Unzip

# Install apache+mysql+php

The code is as follows Copy Code
yum-y install httpd php mysql mysql-server php-mysql

# Start httpd Service

The code is as follows Copy Code
/sbin/service httpd Start

# Start MySQL Service

The code is as follows Copy Code
/sbin/service mysqld Start

# set the MySQL database root account password, quotes inside the password

The code is as follows Copy Code
mysqladmin-u root password ' 123′

# Default Site Directory for/var/www/html/

# Install Apache Extensions

The code is as follows Copy Code
Yum-y Install httpd-manual mod_ssl mod_perl mod_auth_mysql

# Install extensions for PHP

The code is as follows Copy Code
Yum Install PHP-GD
Yum-y Install PHP-GD php-xml php-mbstring php-ldap php-pear php-xmlrpc

# Install MySQL extensions

  code is as follows copy code
yum-y Install Mysql-connector-odbcmysql-devel libdbi-dbd-mysql

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.