Install Mysql + Apache2 + php5

Source: Internet
Author: User
The installation of Mysql + Apache2 + php5 process, read the successful installation of Mysql + Apache2 + php5 process, download the following files to/usr/local/src/Apache2.tar.gzmysql-5.0.22.tar.gzphp-5.1.2.tar.gz decompress: #tarxvzfApache2.tar.gz # tarxvzf download the following files to/usr/local/src/
Apache2.tar.gz
Mysql-5.0.22.tar.gz
Php-5.1.2.tar.gz
Decompress:
# Tar xvzf Apache2.tar.gz
# Tar xvzf mysql-5.0.22.tar.gz
# Tar xvzf php-5.1.2.tar.gz
 
# Cd .. // create a folder in the/usr/local/Directory
# Mkdir apache
# Mkdir mysql
# Mkdir php
 
// Mysql installation process
# Cd ../mysql // find the/usr/local/mysql folder
# Groupadd mysql
# Usseradd-g mysql
 
# Cd ../mysql-5.0.22 // find/usr/local/src/mysql-5.0.22 folder
#. /Configure -- prefix =/usr/local/mysql -- localstatedir =/var/lib/mysql/-- with-client-ldflags =-all-static -- with-mysqld-ldflags =- all-static -- with-mysqld-user = mysql -- enable-consumer er -- with-extra-charsets = all
# Make; make install
 
/Usr/local/mysql/bin/mysql_install_db // initialize mysql
// Configure mysql
# Chown-R root/usr/local/mysql
# Chown-R mysql/var/lib/mysql/
# Chgrp-R mysql/usr/local/mysql
# Cp support-files/my-medium.cnf/etc/my. cnf
 
/Usr/local/mysql/bin/mysqld_safe-user = mysql & // start mysql
 
/Usr/local/mysql/bin/mysqladmin-u root-p password 123 // change the password to 123
Enter password:
              
// Test the new password
/Usr/local/mysql/bin/mysql-u root-p mysql
Enter password: // enter mysql if it succeeds.
      
                 
// Apache installation process
./Configure -- prefix =/usr/local/apache -- enable-Mod = shared = all -- enable-module = so -- disable-info
Make
Make install
 
When libiconv. so.2 is encountered during apache installation, the solution is as follows:
Ln-sf/usr/local/lib/libiconv. so.2/usr/lib/libiconv. so.2
 
// Enter the IP address of the local machine in the window. If a famous feather webpage appears, it will be successful ....
 
 
 
// Php installation process
. /Configure -- prefix =/usr/local/php -- with-mysql =/usr/local/mysql -- with-apxs2 =/usr/local/apache/bin/apxs -- enable-calendar -- with-openssl =/usr/-- with-config-file-path =/usr/local/php
Make
Make install
Cp/usr/local/src/php-5.1.2/php. ini-dist/usr/local/lib/php. ini
 
 
# Cd usr/local/apache/conf
// Open httpd. conf and modify it in the appropriate place.
AddType application/x-httpd-php. php
AddType application/x-httpd-php-source. phps
 
DocumentRoot "/usr/local/apache/htdocs"
 
LoadModule php5_module modules/libphp5.so
 
// Put the tested. Php file in/usr/local/apache/htdocs/. If the page can be opened in the window bar, the success is achieved.
// FAQ 1: ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql. sock' (2)
// Solution: permission issues
Chown-R mysql/var/lib/mysql/
// FAQ 2: Warning: MySQL Connection Failed: Can't connect to local MySQL server
// Through socket '/tmp/mysql. sock' (111) in/home/httpd/html/show. php on line 9
// Solution: link/tmp/mysql. sock to the/var/lib/mysql directory:
Linux # ln-s/var/lib/mysql. sock/tmp/mysql. sock

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.