apache+mysql+php, install the integrated configuration.

Source: Internet
Author: User

1. Packages

Httpd-2.2.31.tar.gz

Mysql-5.1.63.tar.gz

php-5.6.17.tar.bz2

2. Installing Apache

Tar xzf httpd-2.2.31.tar.gz

CD httpd-2.2.31

./configure--prefix=/usr/local/apache2--enable-so--enable-rewrite

Make

Make install

3. Install MySQL

Tar xzf mysql-5.1.63.tar.gz

CD mysql-5.1.63

./configure PREFIX=/USR/LOCAL/MYSQL5--enable-assembler

#error: No Curses/termcap Library found
#解决办法
#yum Install Ncurses-devel

Make

Make install

Configuring the MySQL service for system services

Cp/usr/local/mysql5/share/mysql/my-medium.cnf/etc/my.cnf

Cp/usr/local/mysql5/share/mysql/mysql.server/etc/rc.d/init.d/mysqld

Chkconfig--add mysqld #增加mysqld为系统服务
Chkconfig--level 345 mysqld on #在系统登记345级中开启mysqld服务

#创建mysql用户并更改权限
Cd/usr/local/mysql5
Useradd MySQL
Chown-r MYSQL.MYSQL/USR/LOCAL/MYSQL5

#初始化数据库

/usr/local/mysql5/bin/mysql_install_db--user=mysql

Set var directory permissions

Chown-r mysql var

#后台启动mysql

/usr/local/mysql5/bin/mysqld_safe--user=mysql &

#软链接mysql命令

Ln-s/usr/local/mysql5/bin/mysql/usr/bin/

3.php Installation and Configuration

Tar jxf php-5.3.28.tar.bz2

CD php-5.3.28

#error: Xml2-config not found. Please check your LIBXML2 installation.
#yum Install LIBXML2 Libxml2-devel
./configure PREFIX=/USR/LOCAL/PHP5--with-config-file-path=/usr/local/php5/etc--with-apxs2=/usr/local/apache2/ Bin/apxs--with-mysql=/usr/local/mysql5/

Make
Make install

4.apache+php
Modify the httpd.conf file and add the following statement
LoadModule php5_module modules/libphp5.so (default already exists)
AddType application/x-httpd-php. php
DirectoryIndex index.php index.html (before adding index.php to index.html)

Create a test page under/usr/local/apache2/htdocs, with the following page content:
<?php
Phpinfo ();
?>

Run the address, jump out of the test face, installation success.

apache+mysql+php, install the integrated configuration.

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.