Build a LAMP environment in LINUX

Source: Internet
Author: User
Unzip # extract file 3, cdmysql-5.0.22 # to enter the mysql-5.0.22 directory 4 ,. /configure -- prefix... one installation mysql1installation mysqlinstallation package mysql-5.0.22.tar.gz 2, tar zxvf mysql-5.0.22.tar.gz # Extract Files 3, cd mysql-5.0.22 # enter the mysql-5.0.22 directory 4 ,. /configure -- prefix =/usr/local/mysql if the following error occurs during compilation, it indicates that ncurseschecking for termcap functions library is missing... configure: error: No curses/termcap library foun D 5、install ncurses, download ncursesinstallation package ncurses-5.6.tar.gz 6, tar zxvf ncurses-5.6.tar.gz # Extract Files 7, cd ncurses-5.6 # enter the ncurses-5.6 Directory 8 ,. /configure9, make10, make install # ncurses installation completed 11, return to the mysql-5.0.22 Directory, re-compile mysql. /configure -- prefix =/usr/local/mysql 12, make13, make install14, mkdir/usr/local/mysql/etc # create the directory etc15 under the/usr/local/mysql Directory, cd mysql-5.0.22 cp support-files/my-medium.cnf/usr/local/mysql/etc/my. cnf # Return to mysq In the l-5.0.22 Directory, and copy the mysql configuration file to the etc directory 16. groupadd mysql # Add a mysql linux system Group 17. useradd-g mysql # Create a mysql User and specify it to the mysql group 18, cd/usr/local/mysql/bin mysql_install_db -- user = mysql # enter the installation directory, use the mysql User to initialize database 19 and chown-R root. # Change the owner of all files in the current directory to superuser 20 and chown-R mysql var # Change the owner of all files in the var directory to mysql21 and chgrp-R mysql. # Change the group attribute in the current directory to mysql22, cd/usr/local/mysql/bin mysqld_safe -- user = mysql & # run mysql database 23, netstat-an | g Rep 3306 # check whether the service is up 24 by checking the port. the command for logging on to mysql from the database is mysql. the usage of mysql is as follows: mysql-u username-h host-p password database name [root @ test1 local] # mysqlmysql> the prompt "mysql>" appears. Congratulations! installation successful! The logon format after the password is added is as follows: mysql-u root-pEnter password: (enter the password) where-u is followed by the user name, and-p requires the password, press enter and enter the password. Note: This mysql file is located in the/usr/bin directory. it is not a file with the startup file/etc/init. d/mysql described later. 2) installation apache1、download apr-1.4.5.tar.gz apr-util-1.4.1.tar.gz pcre-8.21.tar.gz httpd-2.4.1.tar.gz2, installation apr 1) tar zxvf apr-1.4.5.tar.gz 2) cd apr-1.4.5 3 ). /configure -- prefix =/usr/local/apr 4) make 5) make install3, install apr-util 1) tar zxvf apr-util-1.4.1.tar.gz 2) cd apr-util-1.4.1 3 ). /configure -- prefix =/usr/local/aprutil 4) make 5) make install4, install pcre 1) tar zxvf pcre-8.21.tar.gz 2) cd pcre-8.21 3 ). /configure -- prefi X =/usr/local/pcre 4) make 5) make install5, install apache 1) tar zxvf httpd-2.4.1.tar.gz 2) cd httpd-2.4.1 3 ). /configure -- prefix =/user/local/apache2 -- with-apr =/usr/local/apr -- with-aprutil =/usr/local/aprutil -- with-pcre =/usr /local/pcre 4) make 5) make install 6) cd/usr/local/apache2/bin 7 ). /apachectl start # start apache 8) open the browser and enter http: // server IP address. The it works page is displayed! Indicating successful apache installation 3. install php1, install freetype 1 download freetype-2.4.3.tar.bz2 2) tar-jxvf freetype-2.4.3.tar.bz2 3) cd freetype-2.4.3 4 ). /configure -- prefix =/usr/local/freetype 5) make 6) make install2. install zlib 1 to download zlib-1.2.3.tar.gz 2) tar zxvf zlib-1.2.3.tar.gz 3) cd zlib-1.2.3 4 ). /configure -- prefix =/usr/local/zlib 5) make 6) make install3. install libpng 1. download libpng1.5.4.tar.gz 2) tar zxvf libpng1.5.4.tar.gz 3) cd libpng-1.5.4 4 ). /configure -- prefix =/usr/local/libpng 5) make 6) make install4, install jpeg 1 download unzip src.v6b.tar.gz 2) tar zxvf unzip src.v6b.tar.gz 3) cd jpeg-6b 4 ). /configure -- prefix =/usr/local/jpeg 5) make 6) make install5, install the gd Library 1‑download gd-2.0.33.tar.gz 2) tar zxvf gd-2.0.33.tar.gz 3) cd gd-2.0.33 4 ). /configure -- prefix =/usr/local/gd 5) make 6) make install6, install libxml2 1loads libxml2-2.7.8.tar.gz 2) tar zxvf libxml2-2.7.8.tar.gz 3) cd libxml2-2.7.8 4 ). /configure -- prefix =/usr/local/glibxml2 5) make 6) make install7. install php 1 download php-5.4.0.tar.gz 2) tar zxvf php-5.4.0.tar.gz 3) cd php-5.4.0 4 ). /configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql =/usr/local/mysql -- with-libxml2 =/usr /local/libxml2 -- with-zlib =/usr/local/zlib -- with-libpng =/usr/local/libpng -- with-jpeg =/usr/local/jpeg --- freetype =/usr/local/freetype -- with-gd =/usr/local/gd # -- with-apxs2 =/usr/local/apache2/bin/apxs will be in/usr/local/ the libphp5.so file is generated in the apache2/modules Directory, PHP cannot be installed successfully without this file. 5) cp php. ini-development/usr/local/php/lib/php. ini # Copy the php configuration file 6) modify the apache configuration file/usr/local/apache/conf/httpd. conf, in http. add LoadModule php5_module modules/libphp5.so # load AddType application/x-httpd-php to libphp5.so. php 7) create the file index in/usr/local/apache2/htdocs. php, the file content is 8) cd/usr/local/apache2/bin. /apachectl restart # restart service 9) open the browser and enter http: // server IP address/index. if php successfully sees the PHP page, it indicates that PHP has successfully installed the Author christina ugly.
Related Article

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.