MYSQL+APACHE2+PHP5 Installation

Source: Internet
Author: User

Download the following files to/usr/local/src/
Apache (the most popular Web server platform for UNIX platforms) 2.tar.gz
MySQL (best combination with PHP) -5.0.22.tar.gz
PHP (as the current mainstream development language) -5.1.2.tar.gz
Decompression:
#tar Xvz (Parallels Virtual line platform) F Apache (the most popular Web server platform for UNIX platforms) 2.tar.gz
#tar Xvz (Parallels Virtual line platform) F MySQL (the best combination of PHP) -5.0.22.tar.gz
#tar Xvz (Parallels Virtual line platform) F PHP (as the current mainstream development language) -5.1.2.tar.gz

#cd. Create a folder in the/usr/local/directory
# mkdir Apache (Unix platform's most popular Web server platform)
# mkdir MySQL (best combination with PHP)
# mkdir PHP (as the current mainstream development language)

MySQL (the best combination of PHP) installation process
#cd. /mysql (best combination with PHP)//Find/usr/local/mysql (best combination with PHP) folder
#groupadd MySQL (best combination with PHP)
#usseradd-G MySQL (best combination with PHP) MySQL (best combination with PHP)

#cd. /mysql (best combination with PHP) -5.0.22//Find/usr/local/src/mysql (best combination with PHP) -5.0.22 folder
#./configure--prefix=/usr/local/mysql (best combination with PHP)--localstatedir=/var/lib/mysql (best combination with PHP)/- With-client-ldflags=-all-static--with-mysql (best combination with PHP) d-ldflags=-all-static--with-mysql (the best combination of PHP) d-user= MySQL (best combination with PHP)--enable-assembler--with-extra-charsets=all
#make; Make install

/usr/local/mysql (best combination with PHP)/bin/mysql (best combination with PHP) _install_db//Initialize MySQL (best combination with PHP)
Configure MySQL (the best combination of PHP)
#chown –R Root/usr/local/mysql (best combination with PHP)
#chown –R MySQL (best combination with PHP)/var/lib/mysql (best combination with PHP)
#chgrp –R MySQL (best combination with PHP)/usr/local/mysql (best combination with PHP)
#cp support-files/my-medium.cnf/etc/my.cnf

/usr/local/mysql (best combination with PHP)/bin/mysql (best combination with PHP) D_safe–user=mysql (best combination with PHP) &//Start MySQL (best combination with PHP)

/usr/local/mysql (best combination with PHP)/bin/mysql (best combination with PHP) admin–u root–p password 123//change Password to 123
Enter Password:

Test the new password
/usr/local/mysql (best combination with PHP)/bin/mysql (best combination with PHP) –u root–p MySQL (best combination with PHP)
Enter Password:///////If it goes well, go to MySQL (the best combination of PHP).


Apache (Unix platform's most popular Web server platform) installation process
./configure--prefix=/usr/local/apache (the most popular Web server platform for UNIX platforms)--enable-mods=shared=all--enable-module=so-- Disable-info
Make
Make install

Apache (Unix platform most popular Web server platform) during the installation process, encountered libiconv.so.2 problems, the solution is as follows:
Ln–sf/usr/local/lib/libiconv.so.2/usr/lib/libiconv.so.2

In the window bar, typing native IP, if the name of the feather Web page, even if successful ....



PHP (as the current mainstream development language) installation process
./configure--prefix=/usr/local/php (as the current mainstream development language)--with-mysql (the best combination of PHP) =/usr/local/mysql (the best combination with PHP)-- With-apxs2=/usr/local/apache (the most popular Web server platform for UNIX platforms)/bin/apxs--enable-calendar--with-openssl=/usr/- With-config-file-path=/usr/local/php (as the current mainstream development language)
Make
Make install
Cp/usr/local/src/php (as the current mainstream development language) -5.1.2/php (as the current mainstream development language). ini-dist/usr/local/lib/php (as the current mainstream development language). ini


#cd Usr/local/apache (the most popular Web server platform for UNIX platforms)/conf
Then open the httpd.conf and modify it in the appropriate place.
AddType application/x-httpd-php (as the current mainstream development language). PHP (as the current mainstream development language)
AddType application/x-httpd-php (as the current mainstream development language)-source. PHP (as the current mainstream development language) s

DocumentRoot "/usr/local/apache (the most popular Web server platform for UNIX platforms)/htdocs"

LoadModule PHP (as the current mainstream development language) 5_module modules/libphp (as the current mainstream development language) 5.so

Put the test. PHP (as the current mainstream development language) file into/usr/local/apache (the most popular Web server platform on UNIX platforms)/htdocs/, if you can open the page in the window bar, you're done.
FAQ 1:error 2002:can ' t connect to local MySQL (best combination with PHP) server through socket '/var/lib/mysql (best combination of PHP)/mysql ( The best combination with PHP). Sock
' (2)
Workaround: Permissions Issues
Chown-r MySQL (best combination with PHP)/var/lib/mysql (best combination with PHP)
FAQ 2:warning:mysql (best combination with PHP) Connection Failed:can ' t connect to local MySQL (best combination with PHP) server
Through socket '/tmp/mysql (best combination with PHP). Sock ' (d) in/home/httpd/html/show.php (as the current mainstream development language) on line 9
Workaround:/tmp/mysql (the best combination with PHP). Sock link to/var/lib/mysql (the best combination of PHP) can be:
linux# ln-s/var/lib/mysql (the best combination of PHP)/mysql (the best combination with PHP). Sock/tmp/mysql (the best combination of PHP). 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.