yum-php Environment Preparation

Source: Internet
Author: User
yum-php Environment Construction
Install apache,mysql,php with Yum.

Install apache,mysql,php with Yum.
2.1 Installing Apache
Yum Install httpd Httpd-devel
When the installation is complete, start Apache with/etc/init.d/httpd start
Set to boot: Chkconfig httpd on
2.2 Installing MySQL
2.2.1 Yum install MySQL mysql-server mysql-devel
Again, when done, start MySQL with/etc/init.d/mysqld start
2.2.2 Setting the MySQL password

Start MySQL console: MySQL

mysql>; Use MySQL;
mysql>; UPDATE user SET Password=password (' newpassword ') WHERE user= ' root ';
mysql>; FLUSH privileges;
2.2.3 Allow remote logins
Mysql-u root-p
Enter Password:
Mysql>grant all privileges on * * to ' user name ' @ '% ' identified by ' password ' with GRANT OPTION;
When you're done, you can manage MySQL remotely with Mysql-front.
2.2.4 Set to boot
Chkconfig mysqld on
3. Install PHP
Yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/ETC/INIT.D/HTTPD start



/Upgrade the default php5.1 to 5.2

VI Gedit/etc/yum.repos.d/utterramblings.repo
Include the following in the open file:
[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
Save
Yum Update php



Installing Zendoptimizer

1. Download the file:

Http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz (32-bit)

Http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz (64-bit)

2. Decompression

After decompression, copy the zendoptimizer.so in the Zendoptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp directory to a directory, such as/usr/local/zend/lib /

Zend Optimizer 3.3.9 There are some new changes, do not need to install, directly in the php.ini file to refer to the. so file:

3. Modify the/etc/php.ini file

Found: Zend.ze1_compatibility_mode = Off

Modified to: Zend.ze1_compatibility_mode = On

Add the following text at the end:

[Zend Optimizer]
Zend_optimizer.optimization_level=1
zend_extension= "/usr/local/zend/lib/zendoptimizer.so"

4, restart httpd service, through the PHP-V can see the effect.



Installing Eaccelerator

Direct Yum Install Php-eaccelerator

If not found, line yum search eaccelerator





When installing a virtual host, note that if multiple domain names are pointing to the same directory

Namevirtualhost 127.0.0.1:80 #这句一定要和 Cooperation is only possible.

Documentroot/var/www/html
ServerName t.dagongz.com

Allow from all
Options +indexes




documentroot/var/www/html/test/
ServerName test.dagongz.com

Allow from all
Options +indexes





Open the cache expires module to have

Expiresactive on
ExpiresDefault "Access plus 86400 second"



Uninstall MySQL



[[email protected] ~]# rpm-qa|grep MySQL

mod_auth_mysql-2.6.1-2.2

php-mysql-4.3.9-3.15

mysql-devel-4.1.20-1.rhel4.1

mysql-4.1.20-1.rhel4.1

mysqlclient10-3.23.58-4.rhel4.1

libdbi-dbd-mysql-0.6.5-10.rhel4.1


Description: Rpm–qa | The grep mysql command is to list all MySQL related packages, the example above is the LinuxAS4 default install MySQL RPM package list,

If it's a list of other Linux versions, it might not be the same, but don't worry, no matter what, uninstall starts with the bottom one, until the first one is uninstalled.

Description: Rpm–e is the command to unload the RPM package, followed by the package name, the final version number is not to fight, such as our next uninstall mysqlclient10-3.23.58-4.rhel4.1 package

Here's how:

Rpm–e mysqlclient


Uninstalling Apache

[Email protected] ~]# Rpm-qa|grep httpd

Httpd-manual-2.0.52-25.ent

System-config-httpd-1.3.1-1

Httpd-2.0.52-25.ent

Httpd-suexec-2.0.52-25.ent


Description: The method is the same as uninstalling MySQL, needless to say.


Uninstalling PHP

[[email protected] ~]# rpm-qa|grep PHP

php-odbc-4.3.9-3.15

php-4.3.9-3.15

php-mysql-4.3.9-3.15

php-pear-4.3.9-3.15

php-ldap-4.3.9-3.15

php-pgsql-4.3.9-3.15


Description: The same method as uninstalling MySQL


Note: If the uninstallation is not removed, the system will generally prompt the package dependencies, and list the name of the dependent package, first uninstall the prompt depends on the package is ready.


If there is really a unloading package, you can add-nodeps this parameter to unload, for example, we uninstall php-4.3.9-3.15, it is not removed.


Just use:

[Email protected] ~]# rpm-e php-4.3.9-3.15--nodeps
  • 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.