show code js

顯示具有 pear 標籤的文章。 顯示所有文章
顯示具有 pear 標籤的文章。 顯示所有文章

2013年9月17日 星期二

install pear to php on windows system


  1. Install pear in php on windows
  2. Download http://pear.php.net/go-pear.phar
  3. goto php directory
  4. open cmd and run php go-pear.phar to start installing pear module
  5. when it is done you can find PEAR_ENV.reg and double click it.
  6. it will change php.ini when it is done to restart your web server.
  7. Test pear, create and run php file, it will show bool(true)
  • <?php
  • require_once 'System.php';
  • var_dump(class_exists('System', false));
  • ?>
  1. If you want to install module of pear, you can open cmd and goto php directory, run pear install module_name.
  2. ex: pear install MDB2
  3. Test MDB2 module, create and run php file, it will show bool(true)
  • <?php
  • ini_set('include_path','c:\php\pear');
  • require_once 'MDB2.php';
  • var_dump(class_exists('MDB2', false));
  • ?>


2011年11月8日 星期二

MDB2 Error: not found

已安裝PEAR及MDB2 並使用MDB2連結資料庫後,發生 MDB2 Error: not found 主要是未安裝相對應的Driver(如MDB2_Driver_datatype) SAMPLE CODE require_once 'System.php'; require_once 'MDB2.php'; $dsn = array( 'phptype' => 'mysqli', 'username' => 'usr', 'password' => 'psw', 'hostspec' => 'localhost', 'database' => 'db', ); $mdb2 = MDB2 :: connect($dsn); echo '
mdb2=' . $mdb2; // on screen is MDB2 Error: not found 請Telnet至主機並進入 opt/share/pear 輸入 # pear install MDB2_Driver_mysql(i) ,若發生pear/MDB2_Driver_mysqli requires PHP extension "mysqli"時,則改以下輸入並安裝即可正常使用 輸入 # pear install -f MDB2_Driver_mysql(i)

2011年10月14日 星期五

QNAP NAS active php and install pear & package

Active Web Server
INSTALL IPKG of QPKG
Active TELNET and login server, command # ipkg install php-pear
modify php.ini at include_path ="/opt/share/pear/";
in telnet, goto /opt/share/pear, and command # pear install MDB2 (sample) to install package