install PHP under Linux to support IMAP
2008-11-26 10:31:10| Category: Linux learning logs | Report | Font size Subscription
First step: Install Apache
Note: The current directory is/tmp,
The directory has httpd-2.2.4.tar.gz, php-5.2.3.tar.gz and other binary source package
#号代表为root root permissions, #后是输入的一条命令
Execute the following command
Unzip the source package
# TAR-ZXF Httpd-2.2.4.tar.gz
Go to the installation directory
# CD httpd-2.2.4
Configuring Apache Installation Information
#./configure--prefix=/usr/local/apache--enable-modules=so--enable-rewrite
Perform a Make installation
# make; Make install
Start the Web server with the following command
#/usr/local/apache/bin/apachectl Start
See if your site is working
Step Two:
shell> Groupadd MySQL
shell> useradd-g MySQL MySQL
Shell> cd/usr/local
Shell> Gunzip </path/to/mysql-version-os.tar.gz | Tar xvf-
shell> ln-s Full-path-to-mysql-version-os MySQL
shell> CD MySQL
Shell> chown-r MySQL.
Shell> chgrp-r MySQL.
Shell> scripts/mysql_install_db--user=mysql
Shell> chown-r Root.
shell> chown-r MySQL Data
Shell> Bin/mysqld_safe--user=mysql &
Specific installation method view, Install-binary
[[email protected] mysql]#./bin/mysqladmin-u root password MySQL
[email protected] mysql]# CP./support-files/mysql.server /etc/init.d/mysql
Start link!!!
Step three: (PHP to support the GD library)
Install GD library (let PHP support Gif,png,jpeg)
First download the Jpeg6,libpng,freetype and install the module
Wget
http://www.ijg.org/files/jpegsrc.v6b.tar.gz
Wget
http://nchc.dl.sourceforge.net/s ... libpng-1.2.8.tar.gz
Wget
HTTP://KEIHANNA.DL.SOURCEFORGE.N ... etype-2.1.10.tar.gz
Wget
http://www.boutell.com/gd/http/gd-2.0.33.tar.gz
Installing JPEG6
Create a 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
# cd/tmp
# TAR-ZXF Jpegsrc.v6b.tar.gz
# CD JPEG-6B
#./configure--prefix=/usr/local/jpeg6/--enable-shared--enable-static
# make; Make install
Installing libpng
# cd/tmp
# TAR-ZXF Libpng-1.2.8.tar.gz
# CD libpng-1.2.8
# CP SCRĪPTS/MAKEFILE.STD Makefile
# make; Make install can also be installed in this way:./configure
Make;make Install
Installing FreeType
# Cd/root/soft
# TAR-ZXF Freetype-2.1.10.tar.gz
# CD freetype-2.1.10
#./configure--prefix=/usr/local/freetype
# Make;make Install
- #安装openssl
- Cd/usr/local/src
- Tar zxvf openssl-0.9.8h.tar.gz
- CD openssl-0.9.8h
- ./config shared Zlib
- Make
- Make Test
- Make install
- Mv/usr/bin/openssl/usr/bin/openssl.save
- Mv/usr/include/openssl/usr/include/openssl.save
- Mv/usr/lib/libssl.so/usr/lib/libssl.so.save
- Ln-s/usr/local/ssl/bin/openssl/usr/bin/openssl
- Ln-s/usr/local/ssl/include/openssl/usr/include/openssl
- Ln-sv/usr/local/ssl/lib/libssl.so.0.9.8/usr/lib/libssl.so
- Cd..
- #配置库文件Search Path
- echo "/usr/local/ssl/lib" >>/etc/ld.so.conf
- Ldconfig-v
- #检测安装结果
- OpenSSL version
- #安装openssh
- Tar xvf openssh-5.0p1.tar.gz
- CD OPENSSH-5.0P1
- ./configure \
- "--prefix=/usr" \
- "--with-pam" \
- "--with-zlib" \
- "--sysconfdir=/etc/ssh" \
- "--with-ssl-dir=/usr/local/ssl" \
- "--with-md5-passwords"
- Make
- Make install
- Cd..
- Service sshd Restart
- Ssh-v
- #安装GD
- Tar jxvf gd-2.0.35.tar.bz2
- CD gd-2.0.35
- Aclocal
- ./configure--PREFIX=/USR/LOCAL/GD2
- Make && make install
- Cd..
- #安装 Libmcrypt
- Tar zxvf libmcrypt-2.5.8.tar.gz
- CD libmcrypt-2.5.8/
- ./configure
- Make
- Make install
- #安装libiconv
- Tar zxvf libiconv-1.12.tar.gz
- CD libiconv-1.12/
- ./configure--prefix=/usr/local
- Make
- Make install
- Cd.. /
- Ln-s/usr/local/lib/libiconv.so.2/usr/lib/
- #安装mhash
- Tar zxvf mhash-0.9.9.tar.gz
- CD mhash-0.9.9/
- ./configure
- Make
- Make install
- Cd.. /
- Ln-s/usr/local/lib/libmhash.so.2/usr/lib/libmhash.so.2
- #安装mcrypt
- Tar zxvf mcrypt-2.6.7.tar.gz
- CD mcrypt-2.6.7/
- ./configure
- Make
- Make install
- Cd.. /
- #安装cronolog
- Tar xvf cronolog-1.6.2.tar.gz
- CD cronolog-1.6.2
- ./configure--prefix=/usr/local/cronolog
- Make && make install
- Cd..
- #安装imap
- Tar zxf imap.tar.z
- CD imap-2007b
- Make LR5 passwdtype=std ssltype=unix.nopwd ip6=4 How to install can see the Readme
- Make SLX
- echo "Set Disable-plaintext nil" >/ETC/C-CLIENT.CF
- mkdir/usr/local/imap-2007b
- mkdir/usr/local/imap-2007b/include/
- mkdir/usr/local/imap-2007b/lib/
- Chmod-r 077/usr/local/imap-2007b
- rm-rf/usr/local/imap-2007b/include/*
- rm-rf/usr/local/imap-2007b/lib/*
- Rm-rf/usr/sbin/imapd
- CP imapd/imapd/usr/sbin/
- CP c-client/*.h/usr/local/imap-2007b/include/
- CP c-client/*.c/usr/local/imap-2007b/lib/
- CP C-CLIENT/C-CLIENT.A/USR/LOCAL/IMAP-2007B/LIB/LIBC-CLIENT.A
- Cd..
Install PHP
./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-config-file-path=/usr/local/ Php/etc--with-mysql=/usr/local/mysql--with-gd=/usr/local/gd2--with-libxml-dir=/usr/local/libxml2/-- with-jpeg-dir=/usr/local/jpeg6/--with-png--with-freetype-dir=/usr/local/freetype--with-zlib-dir=/usr/lib-- With-iconv-dir=/usr/local--with-openssl=/usr/local/ssl--with-curl--with-curlwrappers--with-mcrypt--with-imap=/ usr/local/imap-2007b--with-kerberos--with-bz2--enable-soap--enable-gd-native-ttf--enable-ftp--enable-mbstring- -enable-exif--disable-ipv6--disable-cgi--disable-cli
Make;make Install
When compiling PHP, when using--with-imap, an error was encountered
Checking for Utf8_mime2text signature ... new
Checking for u8t_canonical ... no
Configure:error:utf8_mime2text () has a new signature, but U8t_canonical is missing. This should is not happen. Check Config.log For additional information.
By installing the Libc-client-devel package you can resolve
CentOS 5.2 under
Yum Install Libc-client-devel
Can