Redhat 9 configuration APACHE2.0.50 +PHP5+MYSQL4.0.20+GD Library

Source: Internet
Author: User
Tags ftp ini mysql phpinfo posix upload php client zend

Apache|mysql|php5 Linux to configure the APACHE2.0.50+PHP5.0.3+MYSQL4.0.20+GD library a few days ago, upgrade the server, because of the GD library. Make no PHP4.3.8 so it's a step by step PHP5

In fact, the installation steps and PHP4 only a little bit worse.
If you have a PHP or Apache RPM or a low version installed in your machine, please delete it first.
First of all, server GCC to have, otherwise nothing can do. You can use GCC-V to see if GCC is installed,
#gcc-V
Reading Specs From/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with:. /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)

There are similar information that has GCC,
If you do not, please take the installation CD first and put it on.

Please download all of the following items:
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 your computer doesn't need so much, but it's best to download it.

These I put in my ftp in the soft directory, if you point to the left << FTP >> can not see, it may be the password changed, please see my forum signature download information.

But
Maybe when you see this post, there will be a new version of the software download. Let's see what I can do.

Start loading >>>>>>>>>>>>>>>>>>>>>>>>>

Install MySQL server first

#rpm-IVH mysql-server-4.0.20-0.i386.rpm

Then the client

#rpm-IVH mysql-client-4.0.20-0.i386.rpm

After installation, try to use

#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
Please change your MySQL password.

Install the GD Library Base pack

#rpm-IVH gd-devel-1.8.4-11.i386.rpm

Install XPM Support

#rpm-IVH xpm-3.4k-2.i386.rpm

Install LIBXML2 (remember PHP5 only supports libxml2-2.5.10 version)
#tar ZXVF libxml2-2.5.11.tar.gz
#cd libxml2-2.5.11
#./configure
#make
#make Install

Start loading GD library support
-------------------------------------------------------
ZLIB
#tar ZXVF zlib-1.2.1.tar.gz
#cd zlib-1.2.1
#./configure
#make
#make Install


Jpegsrc
#tar ZXVF jpegsrc.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

And finally, 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


----------------------------------------------
The above everything is very smooth, GD even if the successful installation. If there is a problem, it should be a lack of support packages, in short what to download what to install on.

Follow down and start installing 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 was installing them in the/usr/local/apache2 & PHP directory, respectively.
When I used to make PHP4.3.8, I met
Ext/gd/gd.lo (. text+0x63a): In function ' ZM_DEACTIVATE_GD ':

/root/software/php-4.3.8/ext/gd/gd.c:385:undefined reference to ' Gdfreefontcache '

Collect2:ld returned 1 exit status

Make: * * * * [Sapi/cli/php]error 1

is because the FreeType of GD library is not installed, then I go to download it to install immediately. There's no mistake.

All the installation work is done, and then we will configure it.

Copy php.ini file to correct location
Run in PHP directory
#cp Php.ini-dist/usr/local/php/lib/php.ini

Edit Apache configuration file httpd.conf
#vi/usr/local/apache2/conf/httpd.conf

There are several places to change:

are generally in
#AddType Application/x-tar. tgz
Add one line to the next
#LoadModule Php5_module modules/libphp5.so
AddType application/x-httpd-php. php
If you search anywhere else, you don't have the following.

LoadModule Php5_module modules/libphp5.so
Please remove the # number above

and find
DirectoryIndex index.html Index.html.var
Add index.php in the back to make it the default page for index.php.

Found it
# don ' t use Group #-1 on these systems!
Change the following user name and group to
User Apache
Group Apache
(It turns out to be nobody)

and find
#ServerName
Remove the # and change the IP back to your IP.

Found it
DocumentRoot "/usr/local/apache2/htdocs"
Change the/usr/local/apache2/htdocs to the path where you store the Web page file
For example, I was placed in the/home/easy directory, so i later upload php files on the/home/easy directory, and then use IP access, you can see the home page

In order to make the Chinese web page is not garbled
Found it
Adddefaultcharset iso8859-1
Change the iso8859-1 back to gb2312.

That's almost all, as for apache2 other optimizations, see the Apache configuration in the Www.phpv.net category.

Save the httpd.conf file.

Start it
#/usr/local/apache2/bin/apachectl Start
If nothing goes wrong, write a test page and put it in your web directory, and mine is the/home/easy
#vi/home/easy/index.php
Phpinfo ();

Save. Try playing IP in the tester and you can see the Phpinfo page.



All right, if there's no accident. You can now safely run PHP scripts on your machine to connect to MySQL.


Accelerate 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

All the way down to the default should be good.
Look at the test page again,

Look for it, isn't it?
This program makes 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 and Zend Optimizer v2.5.3, Copyright (c) 1998-2004, by Zend Technologies

All right, all the installation is done.
The next job is the most important!

That's how to use PHP5 to create efficient websites for us.


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.

Tags Index: