# tar -zxvf libmcrypt-2.5.8.tar.gz
# cd libmcrypt-2.5.8/
# ./configure
# make
# make install
# cd libltdl/
# ./configure --enable-ltdl-install
# make
# make install
c.编译mhash【基于离散数学原理的不可逆向的php加密方式扩展库】
1
2
3
4
5
# tar -zxvf mhash-0.9.9.9.tar.gz
# cd mhash-0.9.9.9/
# ./configure
# make
# make install
# tar -zxvf mcrypt-2.6.8.tar.gz
# ./configure
# make
# make install
编译错误1:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
checking for libmcrypt-config... /usr/local/bin/libmcrypt-config
checking for libmcrypt - version >= 2.5.0... no
*** Could not run libmcrypt test program, checking why...
*** The test program compiled, but did not run. This usually means
*** that the run-time linker is not finding LIBMCRYPT or finding the wrong
*** version of LIBMCRYPT. If it is not finding LIBMCRYPT, you'll need to set your
*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
*** to the installed location Also, make sure you have run ldconfig if that
*** is required on your system
***
*** If you have an old version installed, it is best to remove it, although
*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
***
configure: error: *** libmcrypt was not found
编译错误2:
1
2
checking whether mhash >= 0.8.15... no
configure: error: "You need at least libmhash 0.8.15 to compile this program. http://mhash.sf.net/"
解决方法:
1
2
3
# vi /etc/ld.so.conf ##添加如下
/usr/local/lib/
# ldconfig ##重新载入
# tar -zxvf memcache-2.2.7.tgz
# cd memcache-2.2.7/
# /usr/local/php/bin/phpize ##用phpize为PHP添加动态扩展
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
b.编译xcache【开源的opcode缓存器/优化器】
1
2
3
4
5
6
7
8
9
10
11
# tar -zxvf xcache-3.2.0.tar.gz
# cd xcache-3.2.0/
# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
# ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config
# make
# make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
c.编译imagick【可供PHP调用ImageMagick功能的PHP扩展】
1
2
3
4
5
6
7
8
9
10
11
12
# tar -zxvf imagick-3.1.2.tgz
# cd imagick-3.1.2/
# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20131106
Zend Module Api No: 20131226
Zend Extension Api No: 220131226
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make
# make install
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
Installing header files: /usr/local/php/include/php/
错误:
configure时出现如下错误:
1
checking ImageMagick MagickWand API configuration program... configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
错误:
开启nginx时出现如下错误:
nginx: [emerg] mkdir() "/var/tmp/nginx/client/" failed (2: No such file or directory)
解决:
# mkdir -p /var/tmp/nginx/client
# /usr/sbin/nginx
②修改相关nginx配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# vi /etc/nginx/nginx.conf
user www;
server {
listen 80;
server_name localhost;
index index.php index.html;
root /usr/html;
location / {
root html;
index index.html index.htm index.php;
}
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
1
2
3
# /usr/sbin/nginx -t ##测试语法
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful