PHP の変更点   

  • 追加された行はこの色です。
  • 削除された行はこの色です。
  • PHP へ行く。

* PHP [#ya77b54e]
* install [#dd6eb079]
- [[apache]] をソースから入れておく
- [[postgres]] を入れておく

*** pre install [#q73d3eb4]
 yum install libpng-devel libjpeg-devel freetype-devel postgresql-devel

*** 本体 [#e0a80839]
(注意) penguin office を使う場合は php 5.0.5 以下
 wget http://jp2.php.net/get/php-5.2.4.tar.gz/from/this/mirror

 wget http://jp2.php.net/get/php-5.0.5.tar.gz/from/jp.php.net/mirror

 tar xzfp php-*.tar.gz
 cd php-*
 ./configure \
 --with-apxs2filter=/usr/local/apache2/bin/apxs \
 --with-gd \
 --with-freetype-dir \
 --with-png-dir \
 --with-zlib \
 --with-jpeg-dir \
 --with-pgsql \
 --enable-gd-native-ttf \
 --enable-exif \
 --enable-mbstring \
 --enable-mbregex \
 --enable-zend-multibyte 
 make
 make install
 cp php.ini-dist /usr/local/lib/php.ini
 emacs /usr/local/lib/php.ini

 register_globals = On  // QUERY の値を $[NAME属性]で取れる
 post_max_size = 200M   // POST のリミットを上げる
 mbstring.internal_encoding = EUC-JP
 mbstring.http_input = auto
 mbstring.http_output = SJIS
 mbstring.detect_order = auto
 mbstring.substitute_character = none;



http://www.php.net/downloads.php

*** RPM Apache との連携 [#pcc8e65b]
 apt-get remove php
 cp /usr/local/apache2/modules/libphp5.so /etc/httpd/modules

 httpd.conf 
 LoadModule php5_module modules/libphp5.so
 DirectoryIndex に index.php を追加
 AddType application/x-httpd-php .php

* info [#x532ed03]
''PHP'' = ''PHP: Hypertext Preprocessor''
-[[PHP Main Site:http://jp2.php.net/]]
-[[日本PHPユーザー会:http://www.php.gr.jp]]

** メモ [#fb1b8b37]
 とりあえず $_POST , $_GET でとっていたやつは $_REQUEST でとれる。


* Perl -> PHP [#m42a9a7e]
|作業          | perl                     | php|
|パターンマッチ| if($hoge = m/pattern/ )  | if (ereg("pattern",$hoge)) |
|case ignore   | if($hoge = m/pattern/i ) | if (eregi("pattern",$hoge)) |
|リプレース    | $hoge = s/mein/main/ )   | ereg_replace("mein","main",$hoge)|
|foreach       | foreach($hoge){print;}   | foreach($hoge as $v) {print $v;}|
|ループ次      | next;                    | continue;|
|ループ脱出    | last;                    | break; |
|外部コマンド  | $res = system("ls");     | exec("ls",$res);|


* Hello World [#r14e46b4]
 <?php
    print "Hello World";
 ?>


** 参考[#vea88edd]
 http://php.planetmirror.com/manual/ja/function.ereg-replace.php
 http://www.php.net/manual/ja/

----
* 開発環境 [#y6f9a240]
 unzip pleiades*.zip
 mv pleiades c:\pleiades-php
 cd c:\pleiades-php\xampp\php
 emacs php.ini

 置換 \xampp ⇒ ..\..\xampp