Successful installation of the MYSQL+APACHE2+PHP5 process

Source: Internet
Author: User
Download the following files to/usr/local/src/
Apache2.tar.gz
Mysql-5.0.22.tar.gz
Php-5.1.2.tar.gz
Unzip:
#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 under the/usr/local/directory
# mkdir Apache
# mkdir MySQL
# mkdir PHP

MySQL installation process
#cd: /mysql//Find/usr/local/mysql folder
#groupadd MySQL
#usseradd-G MySQL 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-assembler--with-extra-charsets=all
#make; Make install

/usr/local/mysql/bin/mysql_install_db//Initialize MySQL
Configuring 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 Password to 123
Enter Password:
       
Test the new password.
/usr/local/mysql/bin/mysql–u root–p MySQL
Enter Password://If it goes well, you can enter MySQL.
   
        
Apache installation process
./configure--prefix=/usr/local/apache--enable-mods=shared=all--enable-module=so--disable-info
Make
Make install

Apache installation process, encountered libiconv.so.2 problems, the workaround is as follows:
Ln–sf/usr/local/lib/libiconv.so.2/usr/lib/libiconv.so.2

In the window bar to hit the native IP, if the famous feather Web page, even if the success of ....



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
Then open the httpd.conf and make the changes 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 test. php file into/usr/local/apache/htdocs/, and if you can open the page in the window bar, you're done.
FAQ 1:error 2002:can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
Workaround: Permissions 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
Workaround:/tmp/mysql.sock link to the/var/lib/mysql directory:
linux# ln-s/var/lib/mysql/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.