Lamp installation (CentOS6.6, php-5.4.39, httpd-2.4.12, mysql-5.6.24)

Source: Internet
Author: User
Lamp installation (CentOS6.6, php-5.4.39, httpd-2.4.12, mysql-5.6.24) software version:

Pcre-8.36.tar.gz
Apr-1.5.1.tar.gz
Apr-util-1.5.4.tar.gz
Httpd-2.4.12.tar.bz2

Mysql-5.6.24.tar.gz

Libxml2-2.7.8.tar.gz
Libpng-1.5.12.tar.gz
Freetype-2.4.10.tar.gz
Jpegsrc.v7.tar.gz
Gd-2.0.35.tar.gz
Php-5.4.39.tar.gz

Baidu: http://pan.baidu.com/s/1dDGT9KH

Procedure overview:

1. apache

2. mysql

3. php

4. verification

Remarks:

All operations (unless otherwise specified) are in the/usr/local/src directory, and all software packages are in this directory.

Procedure: install apache

Software package dependency: pcre, apr, apr-util

1. prce installation (installation directory, based on the directory where httpd will be installed in the future (/usr/local/services/httpd-2.4.12/) and installed in the directory of plugins for future transplantation of machines of the same model

tar zxf pcre-8.36.tar.gzcd pcre-8.36 ./configure --prefix=/usr/local/services/httpd-2.4.12/plugins/pcre-8.36 make make install

2. the installation documents of apr and apr-util in apache are described as follows:

tar zxf apr-1.5.1.tar.gz -C ./httpd-2.4.12/srclib/tar zxf apr-util-1.5.4.tar.gz -C ./httpd-2.4.12/srclib/cd httpd-2.4.12/srclib/ln -s apr-util-1.5.4/ apr-util ln -s apr-1.5.1 apr

3. install apache

tar zxf httpd-2.4.12.tar.gzcd httpd-2.4.12 ./configure \ --prefix=/usr/local/services/httpd-2.4.12 \ --with-pcre=/usr/local/services/httpd-2.4.12/plugins/pcre-8.36 \ --with-included-apr \ --enable-rewrite=shared \ --enable-somakemake install

Install mysql

Prerequisites: cmake, ncurses-devel, and bison. if not, run yum install xxx directly.

Tar zxf mysql-5.6.24.tar.gzcd mysql-5.6.24 cmake \-DCMAKE_INSTALL_PREFIX: PATH =/usr/local/services/mysql-5.6.24 \-DMYSQL_DATADIR: PATH =/data/mysql \-DEXTRA_CHARSETS = all \-DENABLED_LOCAL_INFILE = 1 \-DWITH_READLINE = 1 \-DMYSQL_USER = mysql \-DENABLED_LOCAL_INFILE = 1 \-DWITH_SSL = yes make install # add a soft connection ln-s/usr/local/services/mysql-5.6.24/mysql # Add PATH echo "PATH = $ PATH: /usr/local/mysql/bin "> >/Etc/profile source/etc/profile # Modify the directory permission mkdir-p/data/mysql chown-R mysql: mysql/usr/local/mysql chown-R mysql: mysql/data/mysql # Copy the configuration file cp/usr/local/mysql/support-files/my-default.cnf/etc/my. cnf # Add user groupadd mysql useradd-g mysql # set my. conf in [mysqld], set datadir =/data/mysql # initialization/usr/local/mysql/scripts/mysql_install_db -- user = mysql -- datadir =/data/mysql -- basedir =/ usr/local/mysq L # set mysql service cp/usr/local/mysql/support-files/mysql. server/etc/rc. d/init. d/mysqld chkconfig -- add mysqld service mysql start # empty password login mysql # mysql set permissions, the same user may have different passwords on different machines. Grant all privileges on *. * to root @ 'localhost' identified by '20140901'; grant all privileges on *. * to root @ '%' identified by '000000'; # log on to mysql-uroot-p123456 with the root password

Note:

Log on to the system for the first time after installation. Segmentation fault is returned.
This is a bug: https://bugs.launchpad.net/percona-server/+bug/1201123
Solution:
1. in the source code package, edit the cmd-line-utils/libedit/terminal file. c. find the code snippet (row 869) char buf [TC_BUFSIZE]; comment on it, find the following variable (row 879) area = buf;, and change it to area = NULL;
2. recompile.

Install php in three steps

1. libxml2

2. gd2

3. php

Install libxml2

tar zxf libxml2-2.7.8.tar.gzcd libxml2-2.7.8 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/libxml2-2.7.8

Install gd

Including: libpng, freetype, jpeg, gd

Install libpng

tar zxf libpng-1.5.12.tar.gzcd libpng-1.5.12 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12

Install freetype

tar zxf freetype-2.4.10.tar.gz cd freetype-2.4.10 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10

Install jpeg

tar zxf jpegsrc.v7.tar.gz cd jpeg-7 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/jpeg-7

Install gd

tar zxf gd-2.0.35.tar.gzcd gd-2.0.35 ./configure \ --prefix=/usr/local/services/php-5.4.39/plugins/gd-2.0.35 \ --with-freetype=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10 \ --with-png=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12 \ --with-jpeg=/usr/local/services/php-5.4.39/plugins/jpeg-7

Install php

./configure \--prefix=/usr/local/services/php-5.4.39 \ --with-mysql=/usr/local/services/mysql-5.6.24 \ --with-mysqli=/usr/local/services/mysql-5.6.24/bin/mysql_config \ --with-apxs2=/usr/local/services/httpd-2.4.12/bin/apxs \ --with-libxml-dir=/usr/local/services/php-5.4.39/plugins/libxml2-2.7.8 \ --with-gd=/usr/local/services/php-5.4.39/plugins/gd-2.0.35 \ --with-freetype-dir=/usr/local/services/php-5.4.39/plugins/freetype-2.4.10 \ --with-png-dir=/usr/local/services/php-5.4.39/plugins/libpng-1.5.12 \ --with-jpeg-dir=/usr/local/services/php-5.4.39/plugins/jpeg-7 \ --enable-mbstring \ --enable-maintainer-zts \ --enable-sockets \ --enable-pcntl \ --enable-sysvmsg \ --enable-sysvsem \ --enable-sysvshm \ --enable-soap \ --enable-shmop \ --enable-bcmath \ --enable-zip \ --enable-calendar \ --enable-ctype \ --enable-dom \ --enable-filter \ --enable-gd-native-ttf \ --enable-hash \ --enable-json \ --enable-posix \ --enable-shared \ --enable-simplexml \ --enable-static \ --enable-tokenizer \ --enable-xml \ --enable-xmlwriter \ --enable-pdo \ --enable-inline-optimization \ --enable-mysqlnd \ --enable-exif \ --enable-sigchild \ --enable-fpmmakemake install

Compilation error:

In file included from /kk/php-5.4.0/ext/gd/gd.c:103:/kk/php-5.4.0/ext/gd/gd_ctx.c: In function ‘_php_image_stream_putc’:

Solve (after google, bug: https://bugs.php.net/bug.php? Id = 55224 ):

In vim/usr/local/services/php-5.4.39/plugins/gd-2.0.35/include/gd_io.h (14 rows) typedef struct gdIOCtx struct Add: void (* data); the modifications are as follows: typedef struct gdIOCtx {int (* getC) (struct gdIOCtx *); int (* getBuf) (struct gdIOCtx *, void *, int); void (* putC) (struct gdIOCtx *, int); int (* putBuf) (struct gdIOCtx *, const void *, int);/* seek must return 1 on SUCCESS, 0 on FAILURE. unlike fseek! */Int (* seek) (struct gdIOCtx *, const int); long (* tell) (struct gdIOCtx *); void (* gd_free) (struct gdIOCtx *); void (* data );}

Re-compile, compilation successful

Configuration and test

1. create a soft connection and add a PATH

ln -s /usr/local/services/php-5.4.39 phpln -s /usr/local/services/httpd-2.4.12 apache ln -s /usr/local/services/mysql-5.6.24 mysql echo "PATH=$PATH:/usr/local/php/bin:/usr/local/mysql/bin" >> /etc/profile source profile

2. set php. ini

cp php.ini-development /usr/local/php/lib/php.ini

3. configure apache httpd. conf to support PHP file parsing

echo "AddType application/x-httpd-php .php" >> /usr/local/apache/conf/httpd.conf

4. build a file test

Vim/usr/local/apache/htdocs/phpinfo. php
   

5. restart apache

/usr/local/apache/bin/apachectl restart

6. access verification

Browser access: http: // 127.0.0.1/phpinfo. php

Shown as follows:

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.