2007年6月22日 星期五

進階使用PHP安裝PEAR

安裝之前要確定你有lynx和php-cli兩套件。
# apt-get install lynx
# apt-get install php-cli

好了,有lynx和php-cli兩套件後,開始安裝PEAR。
# lynx -source http://go-pear.org | php
Welcome to go-pear!

Go-pear will install the 'pear' command and all the files needed by
it. This command is your tool for PEAR installation and maintenance.

Go-pear also lets you download and install the PEAR packages bundled
with PHP: MDB2.


If you wish to abort, press Control-C now, or press Enter to continue:

HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none::

Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.

1. Installation prefix : /usr
2. Binaries directory : $prefix/bin
3. PHP code directory ($php_dir) : $prefix/share/pear
4. Documentation base directory : $php_dir/docs
5. Data base directory : $php_dir/data
6. Tests base directory : $php_dir/tests
7. Temporary files directory : $prefix/temp

#我有改了一些default值,prefix和php_dir。
1-7, 'all' or Enter to continue: all
Installation prefix [/usr] : /usr/share/php
Binaries directory [$prefix/bin] :
PHP code directory ($php_dir) [$prefix/share/pear] : /usr/share/php
Documentation base directory [$php_dir/docs] :
Data base directory [$php_dir/data] :
Tests base directory [$php_dir/tests] :
Temporary files directory [$prefix/temp] :

Below is a suggested file layout for your new PEAR installation. To
change individual locations, type the number in front of the
directory. Type 'all' to change all of them or simply press Enter to
accept these locations.

1. Installation prefix : /usr/share/php
2. Binaries directory : $prefix/bin
3. PHP code directory ($php_dir) : /usr/share/php
4. Documentation base directory : $php_dir/docs
5. Data base directory : $php_dir/data
6. Tests base directory : $php_dir/tests
7. Temporary files directory : $prefix/temp

1-7, 'all' or Enter to continue:

The following PEAR packages are bundled with PHP: MDB2.
Would you like to install these as well? [Y/n] : Y

#下載進行安裝了...網路順利的話,很快就好了!
Loading zlib: ok
Downloading package: PEAR-stable......ok
Downloading package: Archive_Tar-stable....ok
Downloading package: Console_Getopt-stable....ok
Downloading package: Structures_Graph-stable....ok
Bootstrapping: PEAR...................(remote) ok
Bootstrapping: Archive_Tar............(remote) ok
Bootstrapping: Console_Getopt.........(remote) ok
Downloading package: MDB2.............ok
Extracting installer..................ok
warning: pear/PEAR requires package "pear/Archive_Tar" (version >= 1.3.1)
warning: pear/PEAR requires package "pear/Console_Getopt" (version >= 1.2)
warning: pear/PEAR requires package "pear/Structures_Graph" (version >= 1.0.2)
pear/PEAR can optionally use package "pear/XML_RPC" (version >= 1.4.0)
pear/PEAR can optionally use package "pear/PEAR_Frontend_Web" (version >= 0.5.0)
pear/PEAR can optionally use package "pear/PEAR_Frontend_Gtk" (version >= 0.4.0)
install ok: channel://pear.php.net/PEAR-1.6.0
install ok: channel://pear.php.net/Archive_Tar-1.3.2
install ok: channel://pear.php.net/Console_Getopt-1.2.3
install ok: channel://pear.php.net/Structures_Graph-1.0.2
install ok: channel://pear.php.net/MDB2-2.4.1
MDB2: Optional feature fbsql available (Frontbase SQL driver for MDB2)
MDB2: Optional feature ibase available (Interbase/Firebird driver for MDB2)
MDB2: Optional feature mysql available (MySQL driver for MDB2)
MDB2: Optional feature mysqli available (MySQLi driver for MDB2)
MDB2: Optional feature mssql available (MS SQL Server driver for MDB2)
MDB2: Optional feature oci8 available (Oracle driver for MDB2)
MDB2: Optional feature pgsql available (PostgreSQL driver for MDB2)
MDB2: Optional feature querysim available (Querysim driver for MDB2)
MDB2: Optional feature sqlite available (SQLite2 driver for MDB2)
MDB2: To install optional features use "pear install pear/MDB2#featurename"

The 'pear' command is now at your service at /usr/share/php/bin/pear

** The 'pear' command is not currently in your PATH, so you need to
** use '/usr/share/php/bin/pear' until you have added
** '/usr/share/php/bin' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

http://pear.php.net/faq.php
http://cvs.php.net/co.php/pearweb/doc/pear_package_manager.txt?p=1
http://pear.php.net/manual/

Thanks for using go-pear!

root@bullock-desktop:/usr/share#

最後別忘了把剛剛改的
/usr/share/php加到php.ini的inculde_path裡!very very important!
以上!

2007年6月16日 星期六

ubuntu 加裝可創造橋接式網路的套件

這個月我在UBUNTU的使用上有了重大的突破,
那就是設定橋接式網路成功了!
前幾篇的文章一直在談使用VirtualBox,創造出一個虚擬的作業系統出來,
但是安裝好了VirtualBox之後,在要設定橋接式網路之前,
有幾個套件要先裝好。分別是:uml-utilities 、 bridge-utils
裝好之後才可以使用 tunctl 和 brctl 這兩個指令

$sudo apt-get install uml-utilities bridge-utils

以下指令請以root身份執行!
1. 創造一個TAP接口,叫tap0
#tunctl -t tap0 -u username
username 要置換成你自己的帳號!

2. 創造出bridge,叫br0
#brctl addbr br0

3. 把真實網卡設成promiscuous模式,使得它能够接收及發送别的MAC
#ifconfig eth0 0.0.0.0 promisc

這個指令下完,你之前的網卡配置就消失了!
也就是說,此時你的網路會斷線。

4. 接下來mwv 要恢復你的網路連線,把你的真實網卡橋接到bridge br0
#brctl addif br0 eth0

5. 再把真實網卡的配置改到br0上,舉例來說,
若你的eth0的配置是IP:192.168.1.100 netmask:255.255.255.0 ,
而你的gateway:192.168.1.254

#ifconfig br0 192.168.1.100 netmask 255.255.255.0 up
#route add default gateway 192.168.1.254

若是網路是由DHCP配置,則執行
#dhclient br0

6. 最後把TAP接口加進 bridge ,啓動它。
#brctl addif br0 tap0
#ifconfig tap1 up

7. 記得ml更改/dev/net/tun的權限
#chmod 0666 /dev/net/tun

好了,相信你也己經迫不期待想裝個windows玩玩了吧!
有個小技巧分享,我發現在灌xp時,先把橋接式網路設上去,
會造成這個xp網路連線失敗,原因不明!
但我重新以的方式安裝好xp後,再來設定bridge方式上網,
奇也怪哉!就成功了!

參考看看吧!

搜尋此網誌

本站大事記

這個部落格(網站)內容以分享LINUX和延伸出的技術文章為主!
特別是為了工作和進修需要,搜集了不少網站連結。
希望對來這裡觀文的朋友們,有提供一些有用的資訊或文章。
但這裡的文章中,也包含個人的心情扎記和隨興言談……
若是當中沒有對上你的口味,請多包涵!

原「琳娜絲與希斯寇的邂逅」,改名為「愛上琳娜絲」!

原「琳娜絲與希斯寇的邂逅」,改名為「愛上琳娜絲」!
--原序文--
就是當LINUX遇上CISCO啦!他們的結合還能作什麼事…不就是讓這個世界的網路,串…串起來啊…不然你們那能上這網站看部落格!