CentOS安装php_screw模块的脚本

install_php_screw.sh

声明执行该脚本前需要将php_screw-1.5.tar.gz上传至/usr/local/下

#!/bin/sh


#install php_screw

cd /usr/local/

tar zxvf php_screw-1.5.tar.gz

cd /usr/local/php_screw-1.5/

#vi /usr/local/php_screw-1.5/php_screw.h
echo "#define PM9SCREW        \"\tCOOL\t\"
#define PM9SCREW_LEN     6

char *zdecode(char *inbuf, int inbuf_len, int *resultbuf_len);
char *zencode(char *inbuf, int inbuf_len, int *resultbuf_len);" > /usr/local/php_screw-1.5/php_screw.h

#vi /usr/local/php_screw-1.5/my_screw.h
echo "short pm9screw_mycryptkey[] = {
  12852, 968, 192, 1281, 62, 269
};" > /usr/local/php_screw-1.5/my_screw.h

phpize

./configure

make

cd modules

cp php_screw.so /usr/lib/php/modules

#insert strings "extension=php_screw.so" into line 625 of /etc/php.ini
sed -i '625a\extension=php_screw.so' /etc/php.ini

/usr/sbin/apachectl restart

cd /usr/local/php_screw-1.5/tools

make

cp screw /usr/bin

screw /var/www/html/info.php
rm -rf /var/www/html/infophp..screw

你可能感兴趣的:(PHP,centos,脚本,extension)