root@24aa86ae75b9:/home/vrgroup/Desktop# curl localhost #若无curl命令 apt-get install curl <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p>
<p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p> </body> </html> root@24aa86ae75b9:/home/vrgroup/Desktop#
vim /etc/nginx/sites-available/default ------#去掉部分注释保留如下 location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone: # fastcgi_pass 127.0.0.1:9000; # With php5-fpm: fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } -------
apt-get install php5-dev root@24aa86ae75b9:/home/vrgroup/Desktop# git clone https://github.com/phpredis/phpredis.git #若无该命令:apt-get install git root@24aa86ae75b9:/home/vrgroup/Desktop# cd phpredis/ root@24aa86ae75b9:/home/vrgroup/Desktop/phpredis# phpize Configuring for: PHP Api Version: 20121113 Zend Module Api No: 20121212 Zend Extension Api No: 220121212 root@24aa86ae75b9:/home/vrgroup/Desktop/phpredis#
root@24aa86ae75b9:/home/vrgroup/Desktop/phpredis# ./configure root@24aa86ae75b9:/home/vrgroup/Desktop/phpredis# make && make install Build complete. Don't forget to run 'make test'.
php5-fpm -i |grep redis #查看是否安装成功 root@24aa86ae75b9:/home/vrgroup/Desktop/phpredis# php5-fpm -i |grep redis redis Registered save handlers => files user redis rediscluster redis rediscluster PWD => /home/vrgroup/Desktop/phpredis _SERVER["PWD"] => /home/vrgroup/Desktop/phpredis This program is free software; you can redistribute it and/or modify root@24aa86ae75b9:/home/vrgroup/Desktop/phpredis#
编译redis C扩展
1 2 3 4 5 6 7 8 9 10 11 12 13
root@24aa86ae75b9:/home/vrgroup/Desktop/phpredis# cd .. root@24aa86ae75b9:/home/vrgroup/Desktop# git clone https://github.com/redis/hiredis.git root@24aa86ae75b9:/home/vrgroup/Desktop# cd hiredis/ root@24aa86ae75b9:/home/vrgroup/Desktop/hiredis# make 32bit root@24aa86ae75b9:/home/vrgroup/Desktop/hiredis# make install mkdir -p /usr/local/include/hiredis /usr/local/lib cp -a hiredis.h async.h read.h sds.h adapters /usr/local/include/hiredis cp -a libhiredis.so /usr/local/lib/libhiredis.so.0.13 cd /usr/local/lib && ln -sf libhiredis.so.0.13 libhiredis.so cp -a libhiredis.a /usr/local/lib mkdir -p /usr/local/lib/pkgconfig cp -a hiredis.pc /usr/local/lib/pkgconfig root@24aa86ae75b9:/home/vrgroup/Desktop/hiredis#
将main函数中DoRecognition (dec, datafn)函数调用替换为如下代码 while (1){ printf("BRPOP filesQueue 0\n"); printf("block for redis filesQueue. to wakeup it use 'LPUSH filesQueue plpfile' --plpfile was the absolute path of php file to be recognitioned\n"); reply = redisCommand(c,"BRPOP filesQueue 0"); printf("GET file: %s\n", reply->element[1]->str); DoRecognition (dec, reply->element[1]->str);
root@24aa86ae75b9:/home/vrgroup/Desktop/htk/HTKLVRec# make gcc -c -DNO_LAT_LM -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I../HTKLib RedisToHDecode.c In file included from hiredis.h:40:0, from RedisToHDecode.c:60: sds.h:50:1: error: unknown type name 'inline'
按提示删除abs.h文件中两处inline
root@24aa86ae75b9:/home/vrgroup/Desktop/htk/HTKLVRec# make gcc -c -DNO_LAT_LM -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I../HTKLib RedisToHDecode.c RedisToHDecode.c: In function'CreateBestInfo': RedisToHDecode.c:833:10: warning: variable 'lnLabId'set but not used [-Wunused-but-set-variable] LabId lnLabId; ^ RedisToHDecode.c: In function'DoRecognition': RedisToHDecode.c:954:15: warning: variable 'changed'set but not used [-Wunused-but-set-variable] Boolean changed; ^ In file included from hiredis.h:40:0, from RedisToHDecode.c:60: RedisToHDecode.c: At top level: sds.h:50:15: warning: 'sdslen' defined but not used [-Wunused-function] static size_t sdslen(const sds s) { ^ sds.h:55:15: warning: 'sdsavail' defined but not used [-Wunused-function] static size_t sdsavail(const sds s) { ^ mv RedisToHDecode.o RedisToHDecode.orig.o gcc -DNO_LAT_LM -m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH="x86_64"' -Wall -Wno-switch -g -O2 -I../HTKLib -o RedisToHDecode RedisToHDecode.orig.o HLVNet.orig.o HLVRec.orig.o HLVLM.orig.o \ HLVModel.orig.o ../HTKLib/HTKLiblv.a -L/usr/X11R6/lib -lm -L. -lhiredis root@24aa86ae75b9:/home/vrgroup/Desktop/htk/HTKLVRec#