Linux + php5.1.6 + mysql5.0.2 + apache2.0.55 installation and configuration instructions

Source: Internet
Author: User
Linux + php5.1.6 + mysql5.0.2 + apache2.0.55 installation and configuration instructions:
I. installation and configuration process and description of mysql5.0.2:
1. # tar-zvxf mysql-5.0.2-alpha.tar.gz
2. CD mysql5.0.2
3../configure -- prefix =/usr/local/MySQL -- sysconfdir =/etc -- localstatedir =/var/lib/MySQL -- With-charset = GBK
# -- Prefix =/usr/local/MySQL target directory for MySQL Installation
# Sysconfdir =/etc my. ini configuration file path
# Localstatedir =/var/lib/MySQL database storage path
# -- With-charset = GBK default character set (this option must be added if Chinese characters are supported)
4. Make
5. Make install
6. Make clean
Installation completed ......
7. initialize the database
CD/usr/local/MySQL/bin
./Mysql_install_db
If the system does not have a MySQL user, do the following:
Useradd-M-o-r-D/var/lib/MySQL-S/bin/bash-c "MySQL Server"-U 27 MySQL
Then I start MySQL
/Usr/local/MySQL/bin/mysqld_safe &
OK. Check if MySQL works properly.
Mysql-uroot MySQL
If everything is normal, the database is successfully started. congratulations ......
8. After completing the above steps, copy a script in your compiled directory
(MySQL. server is in the/usr/local/MySQL/share/MySQL/directory)
CP support-files/MySQL. Server/etc/rc. d/init. d/mysqld
Chkconfig -- add mysqld
You can use the following command to start or stop a database later:
/Etc/rc. d/init. d/mysqld start
/Etc/rc. d/init. d/mysqld stop
 

Ii. installation and configuration of apache000055: (DSO dynamic compilation)
# Tar-zvxf httpd-2.0.55.tar.gz
# Cd httpd-2.0.55
#./Configure -- prefix =/usr/local/apache2 -- enable-mod-shared = most -- enable-so
# Make
# Make install
# Make clean
After apache2 is installed, you can start Apache to see if you can see the cute feather ......

Iii. installation and configuration of PhP5:
In the process of installing PhP5, it was a wave of twists and turns. Later, I referred to articles on the Internet and loaded more than N libraries. So this record is as follows:
1. libxml2 Installation
Source code: libxml2-2.6.26.tar.gz
Operation Command:
# Tar-zxvf libxml2-2.6.26.tar.gz
# Cd libxml2-2.6.26
#./Configure
# Make
# Make install
# Make clean

2. Install zlib
Source code: zlib-1.2.3.tar.tar
Operation Command:
# Tar-zxvf zlib-1.2.3.tar.tar
# Cd zlib-1.2.3
#./Configure
# Make
# Make install
# Make clean

3. libpng Installation
Source code: libpng-1.2.12.tar.gz
Operation Command:
# Tar-zxvf libpng-1.2.12.tar.gz
# Cd libpng-1.2.12
# Cp scripts/makefile. STD makefile
Edit makefile and change the prefix to prefix =/usr/local/libpng2.
# Make
# Mkdir/usr/local/libpng2
# Make install
# Make clean

4. JPEG Installation
Source code: jpegsrc.v6b.tar.tar
Operation Command:
# Tar-zxvf restart src.v6b.tar.tar
# Cd jpeg-6b
#./Configure -- prefix =/usr/local/configure 6 -- enable-shared
# Make
# Mkdir/usr/local/limit 6
# Mkdir/usr/local/latest 6/include
# Mkdir/usr/local/IPv6/lib
# Mkdir/usr/local/partition 6/bin
# Mkdir/usr/local/IPv6/man
# Mkdir/usr/local/IPv6/man/Man1
# Make install-lib
# Make install
# Make clean

5. Gd Installation
Source code: gd-2.0.33.tar.gz
Operation Command:
# Tar-zxvf gd-2.0.33.tar.gz
# Cd gd-2.0.33
#./Configure -- prefix =/usr/local/GD2 -- With-zlib -- With-PNG =/usr/local/libpng2 -- With-JPEG =/usr/local/defaults 6
Edit makefile Line 2
Cppflags =-I/usr/local/Tables 6/include (this option may also be empty, as long as you refer to the following changes)
Change
Cppflags =-I/usr/local/bytes 6/include-I/usr/local/libpng2/include
# Make
# Make install
# Make clean

6. Install libiconv
Source code: libiconv-1.9.2.tar.gz
Operation Command:
# Tar-zxvf libiconv-1.9.2.tar.gz
# Cd libiconv-1.9.2
#./Configure -- prefix =/usr/local/libiconv
# Make
# Make install
# Make clean

Connect iconv. H to the installation source program of PHP (the installation source program of PHP must be in the same disk directory as iconv. h; otherwise, the link will fail); otherwise, PHP make will fail.
# Cd/usr/home/TY/php-5.1.6/EXT/iconv/(this directory is the installation source directory of PHP)
# Here the php-5.1.6 is the decompressed path below
# Link/usr/local/libiconv/include/iconv. h iconv. h

7. Start to install PhP5
Source code: php-5.1.6.tar.gz
Operation Command:
# Tar-zxvf php-5.1.6.tar.gz
# Cd php-5.1.6
#. /Configure -- prefix =/usr/local/PHP -- with-apxs2 =/usr/local/apache2/bin/apxs -- With-XML -- With-mysql =/usr/local/MySQL -- with-zlib -- With-JPEG-Dir =/usr/local/defaults 6 -- With-PNG-Dir =/usr/local/libpng2 -- With-iconv =/usr/local/libiconv -- With-config-file-Path =/usr/local/lib -- disable-Debug -- enable-safe-mode -- enable-trans-Sid -- enable-memory-limit -- enable- short-tags -- disable-POSIX -- enable-EXIF -- enable-FTP -- enable-sockets

# Make
# Make install
# Make clean
# Cp/usr/src/php-5.1.6/PHP. ini-Dist/usr/local/lib/PHP. ini

PHP installation completed ......

8. Add PHP to Apache
Operation Command:
# Vi/usr/local/apache2/CONF/httpd. conf
(1) Add the following lines in the corresponding part of the httpd. conf file (if some configurations can be added when PhP5 is installed, you do not need to add them again)
Loadmodule php5_module modules/libphp5.so
Addtype application/X-httpd-PHP. php
Add index. php after directoryindex index.html. var

Configuration completed ......

Iv. Test
Then, put the info. php file and test it.

VI/usr/local/apache2/htdocs/test. php
Enter the following code to save the configuration.
<?
Phpinfo ();
?>
Start Apache and access http: // your IP (or your website)/info. php.
If you can see the relevant PHP information, congratulations, all your configurations have been successful .!

It took me two days to complete the above configuration. I sincerely thank my friends who provided help on the Internet for free and recorded it here, I hope to provide some help to others!

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.