Lamp new installation of Linux + Apache + MySQL + PHP + phpMyAdmin + Zend

Source: Internet
Author: User

I 've been posting an article on installing the discuz forum on Windows for almost a month now. I 've been trying to write out the installation process on Linux. After all
The performance of running PHP in Linux is better than that in windows. in fact, installing and compiling software is not very troublesome. It is difficult to combine various components. I encountered a lot of difficulties during the installation and tried a lot.
In this article, if there are no special instructions on the storage location after the software is downloaded, it will be stored under/tmp. The following is the installation process:

 I. InstallationApache ([url] http://archive.apache.org/dist/httpd/binaries/#/url])

A: First check whether the system has installed software of the old version.

[Root @ RedHat ~] # Rpm-Qa | grep MySQL

[Root @ RedHat ~] # Rpm-Qa | grep httpd

[Root @ RedHat ~] # Rpm-Qa | grep PHP

  B: decompress and install Apache

[Root @ RedHat ~] # Cd/tmp

[Root @ RedHat TMP] # tar zxvf httpd-2.2.4.tar.gz

[Root @ RedHat httpd-2.2.4] #./configure -- prefix =/usr/local/httpd \

-- Enable-ISAPI -- enable-file-Cache \

-- Enable-echo -- disable-charset-lite \

-- Enable-charset-lite -- enable-Cache -- enable-disk-Cache -- enable-Mem-Cache \

-- Enable-example -- enable-case-filter-in -- enable-dumpio \

-- Enable-ext-filter -- enable-Deflate -- enable-log-forensic \

-- Enable-logio -- enable-mime-magic -- enable-headers -- enable-proxy-connect \

-- Enable-proxy-FTP -- enable-proxy-HTTP -- enable-SSL -- enable-optional-hook-export \

-- Enable-optional-hook-import -- enable-optional-FN-import -- enable-HTTP -- enable-CGI \

-- Enable-cgid -- enable-speling -- enable-Rewrite -- enable-so -- With-suexec-uidmin \

-- With-suexec-gidmin -- With-suexec-logfile -- With-suexec-safepath -- enable-static-htpasswd \

-- Enable-static-htdigest -- enable-static-rotatelogs -- enable-static-logresolve

[Root @ RedHat httpd-2.2.4] # Make

[Root @ RedHat httpd-2.2.4] # make install

  

  

  

  Ii. InstallationMySQL ([url] http://downloads.mysql.com/archives.php? P = mysql-4.1 [/url])

[Root @ RedHat TMP] # tar zxvf mysql-5.0.41-linux-i686.tar.gz

[Root @ RedHat TMP] # mv mysql-5.0.41-linux-i686/usr/local/MySQL

[Root @ RedHat MySQL] # pwd

/Usr/local/MySQL

[Root @ RedHat MySQL] # groupadd MySQL

[Root @ RedHat MySQL] # useradd mysql-G MySQL

[Root @ RedHat MySQL] # chown-r root.

[Root @ RedHat MySQL] # chown-r Mysql Data

[Root @ RedHat MySQL] # chown-r Mysql Data/MySQL /.

[Root @ RedHat MySQL] # chgrp-r MySQL.

[Root @ RedHat MySQL] # cp./support-files/my-medium.cnf/etc/My. CNF

[Root @ RedHat MySQL] #./scripts/mysql_install_db -- user = MySQL

[Root @ RedHat MySQL] # bin/mysqld_safe -- user = MySQL &

[Root @ RedHat TMP] #/usr/local/MySQL/bin/mysqlshow-P

  Iii. Install the GD library([Url] http://www.boutell.com/gd/#/url])

  A: unzip and installLibpng ([url] http://www.libpng.org/pub/png/libpng.html#/url])

[Root @ RedHat libpng-1.2.16] #./configure -- prefix =/usr/local/PNG

[Root @ RedHat libpng-1.2.16] # Make

[Root @ RedHat libpng-1.2.16] # make install

 B: unzip and installJPEG (ftp://ftp.uu.net/graphics/jpeg)

[Root @ RedHat jpeg-6b] # mkdir/usr/local/JPEG

[Root @ RedHat jpeg-6b] # mkdir/usr/local/JPEG/bin

[Root @ RedHat jpeg-6b] # mkdir/usr/local/JPEG/lib

[Root @ RedHat jpeg-6b] # mkdir/usr/local/JPEG/include

[Root @ RedHat jpeg-6b] # mkdir/usr/local/JPEG/man

[Root @ RedHat jpeg-6b] # mkdir/usr/local/JPEG/man/Man1

[Root @ RedHat jpeg-6b] #./configure -- prefix =/usr/local/JPEG -- enable-shared -- enable-static

[Root @ RedHat jpeg-6b] # Make

[Root @ RedHat jpeg-6b] # make install

  C: unzip and installFreeType ([url] http://www.fretype.org [/url])

[Root @ RedHat freetype-2.3.2] #./configure -- prefix =/usr/local/FreeType2

[Root @ RedHat freetype-2.3.2] # Make

[Root @ RedHat freetype-2.3.2] # make install

  D. decompress and installFontconfig ([url] http://www.fontconfig.org [/url])

[Root @ RedHat fontconfig-2.4.0] #./configure -- prefix =/usr/local/fontconfig \

-- With-FreeType-Config =/usr/local/FreeType2/bin/FreeType-config

[Root @ RedHat fontconfig-2.4.0] # Make

[Root @ RedHat fontconfig-2.4.0] # make install

  E: Install the xmkmf tool.

When installing XPM, you will be prompted that the xmkmf command cannot be found. You need to install the Xorg-devel package and find and install it on the third Disk of the system disk.

[Root @ RedHat TMP] # rpm-IVH freetype-devel-2.1.9-1.i386.rpm

[Root @ RedHat TMP] # rpm-IVH fontconfig-devel-2.2.3-7.i386.rpm

[Root @ RedHat TMP] # rpm-IVH/tmp/xorg-x11-devel-6.8.1-23.EL.i386.rpm

  

F: Unzip and installXPM ([url] http://koala.ilog.fr/ftp/pub/xpm/#/url])

[Root @ RedHat xpm-3.4k] # xmkmf-

[Root @ RedHat xpm-3.4k] # Make

[Root @ RedHat xpm-3.4k] # make install

 G: decompress and install GD

[Root @ RedHat TMP] # tar zxvf gd-2.0.34.tar.gz

[Root @ RedHat gd-2.0.34] #./configure -- prefix =/usr/local/GD -- With-PNG =/usr/local/PNG /\

-- With-JPEG =/usr/local/JPEG/-- With-freetyp =/usr/local/FreeType2 /\

-- With-fontconfig =/usr/local/fontconfig/-- With-XPM

[Root @ RedHat gd-2.0.34] # cp/usr/local/PNG/include/PNG. H ./

[Root @ RedHat gd-2.0.34] # cp/usr/local/PNG/include/pngconf. H ./

[Root @ RedHat gd-2.0.34] # Make

[Root @ RedHat gd-2.0.34] # make install

  

  4. decompress and installPHP ([url] http://www.php.net [/url])

[Root @ RedHat TMP] # tar zxvf php-5.2.3.tar.gz

[Root @ RedHat php-5.2.3] #./configure -- prefix =/usr/local/PHP \

-- With-mysql =/usr/local/MySQL -- with-apxs2 =/usr/local/httpd/bin/apxs \

-- With-libxml-Dir =/usr/include/libxml2/libxml -- With-Gd =/usr/local/GD /\

-- With-PNG =/usr/local/PNG/-- With-JPEG =/usr/local/JPEG/-- With-XPM \

-- With-zlib -- enable-Debug -- enable-magic-quotes -- enable-libgcc \

-- Enable-FTP -- enable-mbstring -- enable-sockets -- With-GNU-LD

[Root @ RedHat php-5.2.3] # Make

[Root @ RedHat php-5.2.3] # make install

[Root @ RedHat php-5.2.3] # cp PHP. ini-recommended/usr/local/PHP/etc/PHP. ini

  

5. Set HTTP. conf to support PHP

[Root @ RedHat php-5.2.3] # vi/usr/local/httpd/CONF/httpd. conf

Addtype application/X-httpd-PHP. php. phtml

Addtype application/X-httpd-PHP-source. PHPs

Directoryindex index.html. var index.htm index. php

  6. decompress and set phpMyAdmin

[Root @ RedHat TMP] # tar zxvf phpMyAdmin-2.11.2-all-languages.tar.gz

[Root @ RedHat TMP] # mv phpMyAdmin-2.11.2-all-languages/usr/local/httpd/htdocs/phpMyAdmin

[Root @ RedHat TMP] # cd/usr/local/httpd/htdocs/phpMyAdmin

[Root @ RedHat phpMyAdmin] # cp./libraries/config. Default. php./config. Inc. php

[Root @ RedHat phpMyAdmin] vi config. Inc. php

$ Cfg ['pmaabsoluteuri '] = 'HTTP: // localhost/phpmyadmin ';

$ Cfg ['servers'] [$ I] ['auth _ type'] = 'http ';

  7. Create a PHP test file and start Apache

[Root @ RedHat TMP] # vi/usrc/local/httpd/htdocs/phpinfo. php

----------------------------

  

----------------------------

[Root @ RedHat TMP] #/usr/local/httpd/bin/apachectl start

In this case, enter [url] http: // ip/phpinfo. php [/url] in the browser. The following figure is displayed, showing that the GD library is correctly installed.

  

Test phpMyAdmin again, and enter [url] http: // ip/phpMyAdmin [/url] in the browser.

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.