LNMP one-key package default does not install the IMAP module, currently need to use, as long as the recompilation into the IMAP module, the following record steps:
Cd/root/lnmp1.0-full/php-5.3.17/ext/imap
Yum-y Install Libc-client-devel
Ln-s/usr/lib64/libc-client.so/usr/lib/libc-client.so
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config--with-kerberos--with-imap-ssl
Make && make install
Edit/usr/local/php/etc/php.ini Find extension_dir, add extension = "imap.so", then reboot php-fpm,/etc/init.d/php-fpm restart
LNMP installation PHP module/extension (no need to reinstall PHP)
Before installation
Prior to installation, it is recommended that you perform/usr/local/php/bin/php-m (this command displays the currently installed PHP module) to see if the modules to be installed are installed.
This paper takes an example of IMAP and EXIF modules.
First, install the IMAP module
1, before installing the IMAP module, you need to install the required library IMAP:
Centos:yum Install Libc-client-devel
Debian:apt-get Install Libc-client-dev
2, first into the PHP installation directory of the EXT directory
For example, the installation directory for PHP is:/root/lnmp0.4-full/php-5.2.10/
Then execute: cd/root/lnmp0.4-full/php-5.2.10/ext/
We're going to install the IMAP module and perform the CD imap/
Re-executing/usr/local/php/bin/phpize returns the following information:
Configuring for:
PHP Api version:20041225
Zend Module Api no:20060613
Zend Extension Api no:220060519
Then execute the following command:
[Root@vpser imap]#./configure--with-php-config=/usr/local/php/bin/php-config--with-kerberos--with-imap-ssl
[Root@vpser imap]# make && make install
After execution returns:
Build complete.
Don ' t forget to run ' make test '.
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
Said to have succeeded, and then modified/usr/local/php/etc/php.ini
Find: Extension_dir Add extension = "imap.so" on the following line
Save, perform/etc/init.d/php-fpm restart reboot.
Enter http://ip/p.php in the browser, open the probe, install the IMAP module before:
After installing the IMAP module:
second, the installation of EXIF module
Installing EXIF does not require a separate installation library, so the steps for installing the library are omitted.
For example, the installation directory for PHP is:/root/lnmp0.4-full/php-5.2.10/
Then execute: cd/root/lnmp0.4-full/php-5.2.10/ext/
We're going to install the Exif module and perform the CD exif/
Re-executing/usr/local/php/bin/phpize returns the following information:
Configuring for:
PHP Api version:20041225
Zend Module Api no:20060613
Zend Extension Api no:220060519
Then execute the following command:
[Root@vpser imap]#./configure--with-php-config=/usr/local/php/bin/php-config
[Root@vpser imap]# make && make install
After execution returns:
Build complete.
Don ' t forget to run ' make test '.
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/
Said to have succeeded, and then modified/usr/local/php/etc/php.ini
Find: Extension = Add the last extension= after extension = "exif.so"
Save, perform/etc/init.d/php-fpm restart reboot.
Under/home/wwwroot/, create a exif.php file with the following contents:
<?php
$exif = Read_exif_data (' img_0001.jpg ');
while (list ($k, $v) =each ($exif)) {
echo "$k: $v <br>\n";
}
?>
Where img_0001.jpg is a photo file.
Before the EXIF module is installed:
After installing the EXIF module:
Can read the EXIF information of the photos.
Installing other modules is also basically the two ways, when./configure--with-php-config=/usr/local/php/bin/php-config to perform this will check the system on whether the library is installed, if not installed on the error, It is OK to install the related libraries by error prompts.
centos-6.3/php5.3.23 P does not recompile php add IMAP Extension Module
Locate the previously installed package, or download the unpacked installation package again:
1. Enter the source code installation package
[Root@hexu.org ~]$ Cd/data/softs/php_packet/php-5.3.23/ext/imap
[Root@hexu.org ~]$ Cd/data/softs/php_packet/php-5.3.23/ext/imap
2. Installing IMAP dependencies
[root@hexu.org imap]$ Yum install-y libc-client-devel
[Root@hexu.org imap]$ ln-s/usr/lib64/libc-client.so/usr/lib/libc-client.so
[root@hexu.org imap]$ Yum install-y libc-client-devel
[Root@hexu.org imap]$ ln-s/usr/lib64/libc-client.so/usr/lib/libc-client.so
3. To install
[Root@hexu.org imap]$/usr/local/php/bin/phpize
[root@hexu.org imap]$./configure--with-php-config=/usr/local/php/bin/php-config--with-imap--with-imap-ssl-- With-kerberos
[root@hexu.org imap]$ make && make install
[Root@hexu.org imap]$/usr/local/php/bin/phpize
[root@hexu.org imap]$./configure--with-php-config=/usr/local/php/bin/php-config--with-imap--with-imap-ssl-- With-kerberos
[root@hexu.org imap]$ make && make install
4. Final adjustment php.ini
[Root@hexu.org imap]$ Vi/usr/local/php/lib/php.ini
# #vi php.ini add following config
[IMAP]
Extension = imap.so
[Root@hexu.org imap]$ Vi/usr/local/php/lib/php.ini
# #vi php.ini add following config
[IMAP]
Extension = imap.so
5. Check if the installation is successful
[Root@hexu.org imap]# Php-v
PHP 5.3.23 (CLI) (built:apr 7 2013 23:20:21)
Copyright (c) 1997-2013 the PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
[Root@hexu.org imap]# php-m | grep IMAP
IMAP # # See here, instructions for successfully installing the
[Root@hexu.org imap]# Php-v
PHP 5.3.23 (CLI) (built:apr 7 2013 23:20:21)
Copyright (c) 1997-2013 the PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
[Root@hexu.org imap]# php-m | grep IMAP
IMAP # # See here, instructions for successfully installing the
In order to install in the above should not have an error, if found to be prompted to find the appropriate dependent package installation, the following example installation process encountered 2 error.
1. No installation libc-client-devel caused by the first step above installation can be, Error info:
Checking for Utf8_mime2text signature ... new
Checking for u8t_decompose ...
Configure:error:utf8_mime2text () has new signature, but U8t_canonical is missing. This should is not happen. Check Config.log For additional information.
Checking for Utf8_mime2text signature ... new
Checking for u8t_decompose ...
Configure:error:utf8_mime2text () has new signature, but U8t_canonical is missing. This should is not happen. Check Config.log For additional information.
2. Cannot find LIBC-CLIENT.A library, need to manually add File link, errof info:
Checking for crypt In-lcrypt ... yes
Configure:error:Cannot Find IMAP library (LIBC-CLIENT.A). Please check your c-client installation.
Checking for crypt In-lcrypt ... yes
Configure:error:Cannot Find IMAP library (LIBC-CLIENT.A). Please check your c-client installation.
Workaround:
[root@hexu.org]$ ln-s/usr/lib64/libc-client.so/usr/lib/libc-client.so
[root@hexu.org]$ ln-s/usr/lib64/libc-client.so/usr/lib/libc-client.so