PHPFIPersonal Home Page Construction KitForm Interpreter 1995 http
- Slides: 39
PHPの歴史 派生もとのPHP/FIは‘Personal Home Page Construction Kit/Form Interpreter’ – 1995年 http: //www. zend. com/zend/hof/rasmus. php PHP/FI-2 までは Rasmus Lerdorf 作 – 1997年 PHP 3からZeev Suraski(Zend社)らが開発 – 1997年 PHP 4はZend Engine(強力なパーサ)搭載 – 1999年 http: //www. zend. com PHP 5はZend Engine 2オブジェクト指向強化 - 2004年
Apacheのインストール Apacheダウンロードサイト http: //www. apache. org/dist/httpd/binaries/win 32/ Windows版Apacheインストーラパッケージ apache_1. 3. 31 -win 32 -x 86 -no_src. msi ※ CGI(php. exeを起動)よりもDSO(モジュール組み込み)の方が レスポンスが速い。 CGI: Common Gateway Interface DSO: Dynamic Shared Object
Apacheの設定(DSO版PHP4) Apacheconfhttpd. conf Directory. Index index. html. var index. php. var # PHP 4(DSO) Load. Module php 4_module "C: /Program Files/Apache Group/PHP 4/sapi/php 4 apache. dll" Add. Module mod_php 4. c # Warningとなる。なくても良い。 Add. Type application/x-httpd-php. php Add. Type application/x-httpd-php-source. phps その他、サーバ設定 Server. Admin, Server. Name, Document. Rootなど
PHP4の設定 Apachephp 4 ts. dll PHP 4php 4 ts. dll を Apache へコピー (あるいは、c: WINDOWSsystem 32 へ) c: WINDOWSphp. ini PHP 4php. ini-recomendedをc: WINDOWSphp. iniにコピー extension_dir = "c: /Program Files/Apache Group/PHP 4/extensions" extension=php_pgsql. dll そのほか、mbstring. * など適宜設定を行う コマンドラインからのCLI版起動テスト ØPHP 4cliphp. exe –i
Apache+PHP 4の起動 Path環境変数にPHP 4のパスを追加 スタート->コントロールパネル->システム->詳細設定->環境変数 PHP 4 D=C: Program FilesPHP 4 PATH=%PHP 4 D%; %PHP 4 D%dlls; %PATH% コマンドラインからApacheを起動 ØApacheApache. exe Apache/1. 3. 31 (Win 32) PHP/4. 3. 8 running. . . PHPファイルのパーステスト Apachehtdocsphpinfo. php を次の内容で作成 <? phpinfo( ); ? > Webブラウザにて http: //localhost/phpinfo. php にアクセス
pg. Installerに含まれるツール Npgsql Microsoft. Netプロバイダー (Global Assembly Cache(GAC)にインストールされる) JDBC Postgre. SQL JDBC ドライバー。 (jdbcサブディレクトリをCLASSPATH環境変数に要追加) psql. ODBC Postgre. SQL ODBCドライバー pg. Admin III Postgre. SQL管理GUI
コマーシャル版IDE Zend Studio http: //www. zend. co. jp/ Price(v. 3. 5): $249 日本語版(v. 3. 5) 価格: 43, 050円 オンラインマニュアル プロジェクト リモートデバグ Active. State Komodo http: //www. activestate. com/Products/Komodo/ Price: $295(Pro 3. 0), $29. 95(Personal 3. 0) Nusphere PHPEd http: //www. nusphere. com/ Price: $299(Additional $50)
オープンソース版IDE Eclipse+Tru. Studio(本格的IDE) http: //trustudio. japansite. org/ DBG+DDD(Unix互換GNU Debugger) http: //www. gnu. org/software/ddd/ DBG+SE(Windows) http: //dd. cron. ru/dbg/ PHP Edit(PHPで書かれている) http: //www. waterproof. fr/ IDE. PHP http: //www. ekenberg. se/php/ide/ Emacs + php-mode (筆者の環境) HTMLテキスト編集とプログラム開発の同時進行
Postgre. SQL関数でのアクセス <? php $sql = ” SELECT * FROM pg_am”; $conn = pg_connect(”host=localhost dbname=template 1 user=postgres password=passwd”); if ($conn) { $result = pg_query($conn, $sql); if ($result) { for ($i=0; $i < pg_numrows($result); $i++) { $name = pg_result($result, $i, ’amname’); print ”Name: $name n”; } pg_freeresult($result); } else { echo ”問合せ失敗! (”. pg_errormessage($conn). ”) n”; } pg_close($conn); } else { echo ”接続に失敗! n”; } ? >
PEAR DBクラスでのアクセス <? php require ’DB. php’; $sql = ”SELECT * FROM pg_am”; $db = DB: : connect(’pgsql: //postgres: passwd@localhost/template 1’); if (DB: : is. Error($db)) { die (”接続失敗: ”. $db->get. Message()); } $result = $db->query($sql); if (DB: : is. Error($result)) { die (”問合せ失敗: ”. $result->get. Message()); } else { while ($row = $result->fetch. Row()) { print ”Name: $row[0] n”; } } $db->free. Result($result); $db->disconnect(); ? >
Postgre. SQLのための設定 Postgre. SQLの設定(postgresql. conf) max_connections = <postgres最大接続数> sort_mem = <ソートに使うバッファ数> shared_buffers = <共有メモリ上のバッファ数> PHPの設定(php. ini) pgsql. max_links = <プロセス当りの最大接続数> pgsql. max_persistent = <接続の内の最大持続的接続数> Apacheの設定(httpd. conf) Max. Clients = <httpd子プロセスの最大数> 注意点 max_connections > pgsql. max_links * Max. Clients shared_buffers > max_connections *2 (8 KB)
文字(文字列)を扱うための Postgre. SQL関数 Postgre. SQLクライアントのエンコーディングを取得 string pg_client_encoding ( [resource connection]) Postgre. SQLクライアントのエンコーディングを設定 int pg_set_client_encoding ([resource connection, string encoding]) テキスト/文字型用の文字列をエスケープする string pg_escape_string ( string data)
PHPのXML関連の関数群 Expat XMLパーサ 最も単純なパーサにはexpatを使用 Apache-1. 3. 7以降に組み込み http: //sourceforge. net/projects/expat/ XSLT(Extensible Stylesheet Language (XSL) Transformations) XMLドキュメントを他のXMLドキュメントに変換する言語 Sabrotron と expat を使用 http: //www. gingerall. com/ DOMXML DOM(Document Object Model)APIでXMLドキュメント処理 GNOME XMLライブラリを使用 http: //www. xmlsoft. org/
PEAR Integrated Templateの例 HTML_Template_IT を使うPHPコード例 <? php require_once ’HTML/Template/IT. php’ $tpl = new HTML_Template_IT(. /); $tpl->load. Templatefile(’テンプレートファイル’, true); $tpl->set. Variable(’NOW’ , date(’Y-m-d(D) h: i’)); $tpl->show(); ? > テンプレートファイルの例 <html> <body> <table> <tr><th>ただいまの時刻</th><td> {NOW} </td></tr> </table> </body> </html>
商用エンコード/キャッシュ モジュール Zend Encoder 3. 0 http: //www. zend. com/store/products/zend-encoder. php Perpetual (lifetime) License $2400 日本語版価格: 400, 000円 Zend Accelerator 2. 0 http: //www. zend. com/store/products/zend-accelerator. php 日本語版価格: 300, 000円 PHTML Encoder http: //www. rssoftlab. com/phpenc. php 4 Windows+Linux(Source): $550 日本語は? Ion. Cube Encoder http: //www. ioncube. com/encoder/ Linux, Free. BSD or Windows $349 日本語版価格: 59, 800円
フリーのエンコード/ キャッシュモジュール PECL APC(Alternative PHP Cache)2. 0 http: //pecl. php. net/apc 10%位改善(QPL -> PHP License) Turck MMCache http: //turck-mmcache. sourceforge. net/ After. Burner Cache http: //afterburner. bware. it キャッシュのみ(LGPL) PHP Accelerator(ion. Cube) http: //www. php-accelerator. co. uk/ バイナリのみフリー (性能は良いらしくyahoo. comで使われている) PEAR bcompiler http: //pear. php. net/manual/en/pecl. bcompiler. php エンコードのみ
- If an error occurs what interpreter do
- Title page in apa format
- Control premium damodaran
- Personal home page php
- Central contractor registration ccr
- Ofwas login
- Starts new page numbered sequentially
- Theme for english b poem
- Personal home page php
- Apa arti dari home care
- Perbedaan home care dan home visit
- Mobile home parks for sale in sc
- Flower plural
- Come home come home jesus is calling
- New mobile home sales oak springs mobile home community
- America my home sweet home
- André fougeron
- She said that, home economics stands for the ideal home.
- Home sweet home survive prayer
- Java compiler translates java source code into
- Mis interpreter
- Example of high level language
- Pengertian compiler dan interpreter
- Definition of compiler
- National consortium of interpreter education centers
- Disadvantages of interpreter
- Bourne shell command interpreter
- Cint c interpreter
- What is pure and impure interpreter
- Cobol pascal
- Compiler assembler and interpreter
- Compiler interpreter and assembler
- Vxml interpreter
- Dshs interpreter ethics quiz
- Pros and cons of compilers and interpreters
- Interpreter
- Interpreter
- Female indian slave who served as interpreter for cortés
- Delphi programlama dili
- Cint interpreter