进入源码目录的 phpext/ 目录
1 2 3 4 5 6 | # cd /scws-1.2.3/phpext # /usr/local/php/bin/phpize #用phpize生成configure配置文件 # ./configure --with-php-config=/usr/local/php5/bin/php-config --with-scws=/usr/local/scwsphpext //configure操作 # make # make install Installing shared extensions: /usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/ //完后返回的路径 |
打开php.ini 跳转到尾部,添加以下代码
1 2 3 | [scws] extension_dir = /usr/local/php5/lib/php/extensions/no-debug-non-zts-20121212/ extension = scws.so |
重启php之后,查看phpinfo()是否有scws扩展
注:configure时提示错误:configure: WARNING: You will need re2c 0.13.4 or later if you want to
解释:需要Re2C 0.13.4版本或以上版本
解决方法
1 2 3 4 5 6 | # wget https: //sourceforge.net/projects/re2c/files/0.16/re2c-0.16.tar.gz # tar zxf re2c-0.16.tar.gz # cd re2c-0.16 # ./configure # make # make install |
注:configure时提示错误:configure: error: Please download and install scws from http://www.xunsearch.com/scws
--with-scws=/usr/local/scwsphpext 其中 scwsphpext目录必须是scws的安装目录