Pure CentOS Installation PHP site environment

Source: Internet
Author: User
Tags imap ldap pear php software

First, MySQL Database

install MySQL:

Yum install MySQL Mysql-server

start MySQL:

/etc/init.d/mysqld start

or service mysqld start

Initial account password root (blank password)

input command MySQL is prompted to indicate that the MySQL installation started successfully, press CTRL + C to exit.

set up mysql with boot chkconfig mysqld on

Second, install PHP

the project needs to be installed Php5.6,yum install PHP can only be installed to php5.3. This linux is older, there is no mirror source address such as php5.5,5.6.

by Yum list php* to see if there is a need to install the version,PHP5.5 named php55w,php5.6 php56w, if there is no need to add a third-party Yum Source, it is recommended to install Webtatic, Source of Rpmforge

1),

This is the installation of the webtatic source, select the corresponding CentOS version

CentOs 5.x

RPM-UVH http://mirror.webtatic.com/yum/el5/latest.rpm

CentOs 6.x

RPM-UVH http://mirror.webtatic.com/yum/el6/latest.rpm

CentOs 7.X

RPM-UVH https://mirror.webtatic.com/yum/el7/epel-release.rpm

RPM-UVH https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

This is the installation Rpmforge source

#32位:

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm

RPM-IVH rpmforge-release-0.5.1-1.el5.rf.i386.rpm

#64位:

wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm

RPM-IVH rpmforge-release-0.5.1-1.el5.rf.x86_64.rpm

2),

after installing the source, you can open the new version of PHP, install PHP and PHP extension

One-click Install all extensions yum--enablerepo=webtatic install php56w*-y--skip-broken

or detailed installation

Yum-y Install php56w

Yum-y Install Php56w-bcmath php56w-cli php56w-common php56w-devel php56w-fpm php56w-gd php56w-imap php56w-ldap php56 W-mbstring php56w-mcrypt php56w-mysql php56w-mysqli php56w-odbc php56w-pdo php56w-pear php56w-pecl-igbinary php56w-x ML Php56w-xmlrpc php56w-opcache php56w-intl Php56w-pecl-memcache

3),

by Yum List installed | grep php can view all installed PHP software
Remove php with yum remove

(attached: The following is the installation Method of PHP5.3)

Yum-y Install PHP

Install some PHP Extensions:

Yum-y Install php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

Third, installation Apache

may have already installed, try restarting first:service httpd restart

Otherwise install yum install httpd and then start

Set Apache boot chkconfig httpd on

Default Site Directory /var/www/html

Apache configuration file/etc/httpd/conf/httpd.conf

PHP configuration file/etc/php.ini

Edit the configuration file httpd.conf, search for "#ServerName", add ServerName localhost:80

Pure CentOS Installation PHP site environment

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.