Configure APACHE2.0.50 + PHP5.0.3 + MYSQL4.0.20 + GD library in linux

Source: Internet
Author: User
In linux, configure APACHE2.0.50 + PHP5.0.3 + MYSQL4.0.20 + GD library-Linux Enterprise Application-Linux server application information. For more information, see the following. A few days ago, when I upgraded the server, because of the GD library, I installed PHP5 step by step because I couldn't make PHP4.3.8.

In fact, the installation steps are only a little different from those of PHP4.
If the RPM or earlier version of PHP or APACHE is installed on your machine, delete it first.
First, you must have GCC on the server. Otherwise, you cannot do anything. You can use gcc-v to check whether GCC is installed,
# Gcc-v
Readingspecs from/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured :.. /configure -- prefix =/usr -- mandir =/usr/share/man -- infodir =/usr/share/info -- enable-shared -- enable-threads = posix -- disable-checking -- with-system-zlib -- enable-_ cxa_atexit -- host = i386-redhat-linux
Thread model: posix
Gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34)

The above similar information indicates that GCC already exists,
If you do not have one, install the CD first.

Download all of the following:
Httpd-2.0.50.tar.gz
MySQL-client-4.0.20-0.i386.rpm
MySQL-server-4.0.20-0.i386.rpm
Php-5.0.3.tar.gz

ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz

Gd-2.0.28.tar.gz
Libxml2-2.5.11.tar.gz
Zlib-1.2.1.tar.gz
Jpegsrc.v6b.tar.gz
Libpng-1.2.5.tar.gz

Xpm-3.4k-2.i386.rpm
Gd-devel-1.8.4-11.i386.rpm

Maybe you don't need so many computers, but you 'd better download them all.

I put these files in the soft directory of my FTP. If you can't see them by clicking <FTP> on the left, the password may have changed, please refer to the download information in my forum signature.

However,
You may see a new version of the above software downloaded when you see this post.

Start installation >>>>>>>>>>>>>>>>>>>>>>>>

First install the MYSQL server

# Rpm-ivh MySQL-server-4.0.20-0.i386.rpm

Then the client

# Rpm-ivh MySQL-client-4.0.20-0.i386.rpm

Try again after installation

# Mysql
Welcome to the MySQL monitor. Commands end with; or g.
Your MySQL connection id is 27651 to server version: 4.0.20-standard
Type 'help; 'or 'H' for help. Type 'C' to clear the buffer.

Description OK
Change the mysql password.

Install basic GD library package

# Rpm-ivh gd-devel-1.8.4-11.i386.rpm

Install XPM support

# Rpm-ivh xpm-3.4k-2.i386.rpm

Install libxml2 (remember that PHP5 only supports libxml2-2.5.10 and later versions)
# Tar zxvf libxml2-2.5.11.tar.gz
# Cd libxml2-2.5.11
#./Configure
# Make
# Make install

Start to install GD library support
-------------------------------------------------------
ZLIB
# Tar zxvf zlib-1.2.1.tar.gz
# Cd zlib-1.2.1
#./Configure
# Make
# Make install


JPEGSRC
# Tar zxvf restart src.v6b.tar.gz
# Cd jpegsrc-6b
#./Configure
# Make
# Make install-lib
# Make install

LIBPNG
# Tar zxvf libpng-1.2.5.tar.gz
# Cd libpng-1.2.5
# Cp scripts/makefile. linux Makefile
#./Configure
# Make
# Make install-headers
# Make install

Last is GD2 .*

Gd-2.0.28
# Tar zxvf gd-2.0.28.tar.gz
# Cd gd-2.0.28
#./Configure -- with-png =/usr/local -- with-jpeg =/usr/local -- with-freetype =/usr
# Make
# Make install


----------------------------------------------
If everything above is successful, GD is successfully installed. If there is a problem, it should be a lack of support packages. In short, if there is nothing to download and install.

Next, install APAHCHE2 and PHP5.

# Tar zxvf httpd-2.0.50.tar.gz
# Cd httpd-2.0.50
#./Configure -- prefix =/usr/local/apache2 -- enable-module = so
# Make
# Make install

# Tar zxvf php-5.0.3.tar.gz
# Cd php-5.0.3
#. /Configure -- prefix =/usr/local/php -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-jpeg-dir =/usr/local -- with-png- dir =/usr/local -- with-gd =/usr/local -- enable-trace-vars -- with-zlib-dir =/usr/local-with-mysql =/var/ lib/mysql
# Make
# Make install



I installed them in the/usr/local/apache2 & PHP Directory respectively.
When I used to MAKE PHP4.3.8
Ext/gd. lo (. text + 0x63a): In function 'zm _ deactivate_gd ':

/Root/software/php-4.3.8/ext/gd. c: 385: undefined reference to 'gdfreefontcache'

Collect2: ld returned 1 exit status

Make: *** [sapi/cli/php] Error 1

The reason is that the freetype of the GD library is not installed. Then I will download it and install it immediately.

After all the installation work is completed, we will configure it.

Copy the PHP. ini file to the correct location.
Run in the PHP Directory
# Cp php. ini-dist/usr/local/php/lib/php. ini

Edit the apache configuration file httpd. conf.
# Vi/usr/local/apache2/conf/httpd. conf

You need to modify the following items:

Generally
# AddType application/x-tar. tgz
Add a row below
# LoadModule php5_module modules/libphp5.so
AddType application/x-httpd-php. php
If you do not search for any of the following items

LoadModule php5_module modules/libphp5.so
Remove the # above

Also found
DirectoryIndex index.html. var
Add index. php to the end to make index. php a response page.

Find
# Don't use Group #-1 on these systems!
Change the following username and group
User apache
Group apache
(It seems to be nobody)

Find
# ServerName
Remove #, and change the following IP address to your IP address.

Find
DocumentRoot "/usr/local/apache2/htdocs"
Change/usr/local/apache2/htdocs to the path where your webpage files are stored.
For example, I put it in the/home/easy directory, so I will upload the PHP file and put it in the/home/easy directory. Then I can access it by using an IP address to see the home page.

To prevent Chinese webpages from being garbled
Find
Adddefacharcharset iso8859-1
Change the following iso8859-1 to gb2312

That's all.

Save the httpd. conf file.

Start it
#/Usr/local/apache2/bin/apachectl start
If no error occurs, write a test page and put it in your webpage directory. What I said above is/home/easy.
# Vi/home/easy/index. php
Phpinfo ();

Save. Try IP address in the tester to view the PHPINFO page.



Okay. If there is no accident, you can run the PHP script on your machine to connect to mysql now.


Accelerating PHP with ZendOptimizer-2.5.3

# Tar zxvf ZendOptimizer-2.5.3-linux-glibc21-i386.tar.gz
# Cd ZendOptimizer-2.5.3-linux-glibc21-i386
#./Install. sh

By default, it should be fine.
Let's look at the test page,

Look for something like this?
This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies with Zend Extension Manager v1.0.3, Copyright (c) 2003-2004, by Zend Technologies with Zend Optimizer v2.5.3, Copyright (c) 1998-2004, by Zend Technologies

All right, the installation is complete.

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.