# [linux]用shell script安裝swfed

- URL: https://justfly.idv.tw/linux%e7%94%a8shell-script%e5%ae%89%e8%a3%9dswfed/
- 日期: 2010-09-02
- 分類: 瞎子摸OS
- 標籤: Apache, install, JustWorks, Linux, swf, swfed

在上一篇[[flash lite 2.0 & php]在flash lite中動態換圖片](https://justfly.idv.tw/2010/07/24/Just_885.html)中說到[swfed](http://pwiki.awm.jp/~yoya/?swfed)這個好東西

不過在使用前還是要先在server上安裝好

如果只有一台也就算了

偏偏這次的手機遊戲總共包括了30台前端server跟兩台DB還有一台admin&test server

即使扣掉DB也夠讓兩個工程師裝到眼花花了

這時就不得不讚嘆一下shell script的方便拉

[下載](http://sourceforge.jp/projects/swfed/releases/)後解壓縮到各server的相同路徑下（/var/www/html/app/dl/swfed-0.20/src/）

參考[官網](http://pwiki.awm.jp/~yoya/?swfed)做好shell檔（setup.sh）：

```
#!/bin/sh

yum -y --enablerepo=remi install php-devel
yum -y install gcc

cd /var/www/html/app/dl/zlib-1.2.5/
./configure --shared --libdir=/lib
make
make install

cd /var/www/html/app/dl/swfed-0.20/src/
phpize
./configure --with-zlib --with-png --with-gif
make
make install
```

幾乎就剩下ssh過去執行的事了

不過最後我們才想到

還要在php.ini中加上extension的設定

```
extension=swfed.so
```

然後

```
/etc/rc.d/init.d/httpd restart
```

才真的大功告成～
