Lamp Environment Construction (source package installation)

Source: Internet
Author: User
Tags chmod phpmyadmin
I. Get package to save everybody time, here will all use the package to share out, we can download here http://pan.baidu.com/s/1nuLD3sd httpd http://www.apache.org/mysql http:// dev.mysql.com/downloads/php http://php.net/downloads.php phpMyAdmin Https://www.phpmyadmin.net/downloads/libxml Http://xmlsoft.org/sources/libmcrypt zlib http://zlib.net/gd autoconf freetype libpng jpegsrc Zendoptimezer
Two. Installation sequence of each source package (1) Before installing PHP, you should install PHP5 required library files, such as LIBXML2, Libmcrypt and GD2 (2) Installation GD2 is to allow PHP to support GIF, PNG, JPEG and other picture formats, Install GD2 before installing the zlib, libpng, FreeType, jpegsrc and other library files (3) The installation process will also be other documents, everyone in accordance with my installation in the following order
Three. Installation of the relevant tool software, to avoid errors in the installation process, the following three select one can be 1. Installation method one Yum Groupinstall ' Development Tools ' yum install Libtool-ltdl-devel
2. Installation mode two yum-y install gcc yum-y install gcc-c++ yum make
3. Installation mode three yum-y install GCC gcc-c++ kernel-devel
Four. Uninstall the old version of the software 1. Uninstall Apache open command line terminal Su-//switch to root User Service httpd status//view Apache, if running, use command service httpd stop to run RPM-QA | grep httpd//view HTTPD installation package, usually installs the operating system automatically installs httpd, the version is older, here unloads it, installs the new edition httpd RPM-E package name--nodeps//--nodeps to indicate does not consider the dependency relation rm-rf/etc /HTTPD//Delete configuration file
2. Uninstall MySQL Rpm-qa | grep mysql RPM-E package name--nodeps//--nodeps Representations do not consider dependencies
Other packages can be removed by the way they are
Five. Installation 1. After downloading all the packages, upload the Linux/usr/local/src directory via SSH or other tools, and you can also place 2. Extract tar.gz Package command: Tar zxvf *.tar.gz * Replace with specific package name 3. Configuration (Configure) 4. Compile (make) 5. Install (make install)
Note The order of the Software Installation (1) LIBXML2 CD libxml2-2.7.8 pwd/usr/local/src/libxml2-2.7.8 (This step simply tells the reader where the directory is, not necessarily)./configure--prefix=/ USR/LOCAL/LIBXML2 make && make install if there is no special instructions, other software to install according to the above steps, do not explain the (2) Libmcrypt (3) zlib//installation do not specify--prefix= (4) libpng (5) Jpeg6 installation needs to first build the relevant directory Mkdir/usr/local/jpeg6 Mkdir/usr/local/jpeg6/bin Mkdir/usr/local/jpeg6/lib mkdir/usr/ Local/jpeg6/include Mkdir/usr/local/jpeg6/man mkdir/usr/local/jpeg6/man/man1 (6) FreeType (7) autoconf Install without specifying--prefix (8) gd./configure--prefix=/usr/local/gd2--with-zlib=/usr/local/zlib--with-jpeg=/usr/local/jpeg6- -with-png=/usr/local/libpng--with-freetype=/usr/local/freetype (9) Apr apr-util./configure--prefix=/usr/local /apr-util--with-apr=/usr/local/apr (one) Pcre Apache must ensure that APR, Apr-util, pcre are installed./configure \--prefix=/usr/local/ apache2 \--sysconfdir=/etc/httpd \--with-z=/usr/local/zlib \--with-apr=/usr/local/apr \--with-apr-util=/usr/local/ Apr-util \--with-pcre=/usr/local/pcre \--enable-so \--enable-deflate=shared \--enable-expires=shared \--enable-rewrite=shared \--enable-static-support
/usr/local/apache2/bin/apachectl Start//start Apache/usr/local/apache2/bin/apachectl stop//close Apache NETSTAT-TNL | grep 80///can also view echo "/usr/local/apache2/bin/apachectl start" >>/etc/rc.d/rc.local//Add self-launch via browser
(13) Install MySQL need to rely on the package yum install Ncurses-devel libaio-devel-y (14) to install the software required to compile MySQL cmake (high version of MySQL using CMake to install) CD The CMake directory after decompression./configure gmake gmake Install
MySQL useradd-s/sbin/nologin-m mysql id mysql (view) CD-unpacked MySQL package directory cmake. -dcmake_install_prefix=/usr/local/mysql \-dmysql_datadir=/usr/local/mysql/data \-DMYSQL_UNIX_ADDR=/usr/local/ Mysql/tmp/mysql.sock \-ddefault_charset=utf8 \-ddefault_collation=utf8_general_ci \-DEXTRA_CHARSETS=gbk,gb2312, UTF8,ASCII \-denabled_local_infile=on \-dwith_innobase_storage_engine=1 \-dwith_federated_storage_engine=1 \-DWITH _blackhole_storage_engine=1 \-dwith_example_storage_engine=1 \-dwith_partition_storage_engine=1 \-DWITH_FAST_ Mutexes=1 \-dwith_zlib=bundled \-denabled_local_infile=1 \-dwith_readline=1 \-dwith_embedded_server=1 \-DWITH_DEBUG =0
Make make Install
Initialize MySQL configuration file my.cnf cp/usr/local/mysql/support-files/my-small.cnf/etc/my.cnf
Set up MySQL data file directory, if it exists, this step can omit mkdir-p/usr/local/mysql/data
Authorize MySQL user to manage MySQL installation directory Chown-r mysql.mysql/usr/local/mysql/
Initialize MySQL database file/usr/local/mysql/scripts/mysql_install_db--basedir=/usr/local/mysql--datadir=/usr/local/mysql/ Data--user=mysql
If there is no TMP directory under/usr/local/mysql/, create mkdir/usr/local/mysql/tmp ls-ld/usr/local/mysql/tmp chmod-r 1777/usr/local/mysql/ tmp/
Set the MySQL startup script cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld chmod +x/etc/init.d/mysqld
Start MySQL database/etc/init.d/mysqld start Netstat-lntup | grep MySQL//See if MySQL database starts
Set MySQL boot boot chkconfig--add mysqld chkconfig mysqld on Chkconfig--list mysqld
Configure the global use path for the MySQL command echo ' export path=/usr/local/mysql/bin: $PATH ' >>/etc/profile tail-1/etc/profile//View Source/et C/profile//make content added to/etc/profile active echo $PATH//view
We can use MySQL now.
MySQL security settings mysqladmin-u root password ' mypassword '//mysqladmin can be used directly, because the previous added global use path MySQL/can not directly login mysql-uroot-p//Input Secret After the code can log on to the MySQL PHP cd after extracting the PHP directory./configure--prefix=/usr/local/php \--with-config-file-path=/usr/local/php/etc \ WITH-APXS2=/USR/LOCAL/APACHE2/BIN/APXS \--with-mysql=/usr/local/mysql \--WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2 \-- WITH-JPEG-DIR=/USR/LOCAL/JPEG6 \--with-freetype-dir=/usr/local/freetype \--with-gd=/usr/local/gd2 \--with-mcrypt= /usr/local/libmcrypt \--with-mysqli=/usr/local/mysql/bin/mysql_config \--enable-soap \--enable-mbstring=all \-- Enable-sockets
Error executing yum install-y libjpeg-devel yum install-y libpng-devel Yum install-y
Make make Install
PHP.ini cp/usr/local/src/php Directory/php.ini-production/usr/local/php/etc/php.ini
Modify the Apache configuration file vim/etc/httpd/httpd.conf add AddType application/x-httpd-php. php. phtml
Restart Apache/usr/local/apache2/bin/apachectl restart












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.