Install PHP running Environment on CentOS (notes)

Source: Internet
Author: User
Tags gpg install php iptables zend

-, configure Apache

1. Close the firewall
Service Iptables Stop
Chkconfig iptables off

2. Open Apache
Service httpd Status
Service httpd Start

3. Change http.conf Configuration
Servertokens os–> Servertokens Prod
Serversignature on–> serversignature off

DirectoryIndex index.html Index.html.var
–>
DirectoryIndex index.html index.php

Change Administrator Mailbox

#ServerName new.host.name:80–> to modify as needed

Options Indexes followsymlinks–> options Includes execcgi followsymlinks

#AddHandler cgi-script .cgi–> AddHandler cgi-script. cgi. pl

allowoverride None-> allowoverride All

Logformat "%h%l%u%t"%r "%>s%b"%{referer}i ""%{user-agent}i "" combined
–>
Logformat "%h%l%u%t"%!414r "%>s%b"%{referer}i ""%{user-agent}i "" combined

Options Indexes multiviews–> Options MultiViews

But it's off the Apache test page.
Rm-f/etc/httpd/conf.d/welcome.conf/var/www/error/noindex.html

Chkconfig httpd on
Chkconfig–list httpd

Second, configure PHP

1. New PHP test page
Echo ' <?php phpinfo (); ' >/var/www/html/index.php

2. Upgrade PHP 5.1.6-> 5.2.16
Rpm–import Http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

Vim/etc/yum.repos.d/centos-base.repo
Add Content:
[Utterramblings]
Name=jason ' s utter ramblings repo
baseurl=http://www.jasonlitka.com/media/el$releasever/$basearch/
Enabled=1
Gpgcheck=1
Gpgkey=http://www.jasonlitka.com/media/rpm-gpg-key-jlitka

Yum-y Update php

Yum-y Install Libmcrypt
Yum-y Install Php-mcrypt

Yum-y Install PHP-GD

Yum-y Install Php-soap
Yum-y Install Php-json
Yum-y Install php-mbstring

Install Zend-opterate

Cd/usr/local/src
wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
Tar zxvf zendoptimizer-3.3.3-linux-glibc23-i386.tar.gz
CD zendoptimizer-3.3.3-linux-glibc23-i386
./install.sh
Cd.. /
RM-RF zendoptimizer*

Third, configure MySQL

Yum install MySQL
Yum-y Install Mysql-server
Yum Install Mysql-devel

Chgrp-r Mysql/var/lib/mysql
Chmod-r 770/var/lib/mysql

Service mysqld Start

Yum-y Install Php-mysql
Service httpd Restart

Vim/etc/my.cnf

Add to
Default-character-set = UTF8

[MySQL]
Default-character-set = UTF8

Chkconfig mysqld on
Chkconfig–list mysqld

Set Password
Mysql-u Root

Select User,host,password from Mysql.user;

Set password for Root@localhost=password (' 123456′);

Set password for Root@127.0.0.1=password (' 123456′);

Set password for Root@all-star=password (' 123456′);

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.