Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: PHP 4 から PHP 5 への移行 - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

その他の質問" width="11" height="7"/> <PHP 3 から PHP 4 への移行
Last updated: Thu, 31 May 2007

view this page in

第61章 PHP 4 から PHP 5 への移行

この章は、PHP 4 から PHP 5 への移行の助けになることでしょう。

61.1. PHP 4 から PHP 5 への移行
61.2. MySQL は PHP 5 で動きますか? 見当たらないようなのですが。
61.3. PHP 5 ではまったく新しいオブジェクト指向モデルが採用されていると 聞きましたが、既存のオブジェクト指向なコードは動きますか? 新しい オブジェクト指向モデルについての情報はどこで得られますか?
61.4. 新しいオブジェクト指向モデル以外に、PHP 5 で何が変わったのですか? また、PHP 5 に特化した PHP のマニュアルはありますか?
61.1. PHP 4 から PHP 5 への移行

PHP 5 では多くの新機能を提供してますが、以前のバージョンの PHP との互換性を可能な限り保っています。しかし、いくつかの機能について は互換性が失われています。

マニュアルの PHP 5 への移行に関する付録 の適切な箇所を参照してください。PHP 5 への移行に関するさらに 重要な情報が得られます。

61.2. MySQL は PHP 5 で動きますか? 見当たらないようなのですが。

MySQL はサポートされています。 たったひとつこれまでと変わったところは、PHP 5 では MySQL のサポートが 標準では 有効になっていないということです。つまり、 configure オプションに --with-mysql が含まれていないので、 PHP をコンパイルする際に手動でこのオプションを設定する必要があります。 Windows ユーザは、php.ini を編集して php_mysql.dll DLL を有効にします。PHP 4 では このような DLL は存在しませんでした。この機能は PHP バイナリの中に 直接埋め込まれていたのです。

また、MySQL クライアントライブラリは PHP には同梱されていません。 詳細についてはこの FAQ に 記述されています。また MySQL のインストール方法については MySQL 関数 を参照してください。 configure 設定の例は --with-mysql=/usr のようになります。Windows ユーザは、 libmySQL.dll が システムに存在する必要があります。

61.3. PHP 5 ではまったく新しいオブジェクト指向モデルが採用されていると 聞きましたが、既存のオブジェクト指向なコードは動きますか? 新しい オブジェクト指向モデルについての情報はどこで得られますか?

PHP 5 での主要な変更点は新しいオブジェクト指向モデルであり、それは Zend Engine 2.0 を用いています。 zend.ze1_compatibility_mode ディレクティブを設定することで、 Zend Engine 1.0 (PHP 4) との互換性を保つことができます。

新しいオブジェクト指向モデルについては、 クラスとオブジェクト新しい オブジェクトモデル の章に記述されています。

61.4. 新しいオブジェクト指向モデル以外に、PHP 5 で何が変わったのですか? また、PHP 5 に特化した PHP のマニュアルはありますか?

それ以外の変更点はほとんどありません。詳細は PHP 4 から PHP 5への移行 を参照して ください。PHP 5 に特化されたマニュアルはありません。というのも、PHP の 大半の部分はこれまでと同じだからです。



add a note add a note User Contributed Notes
PHP 4 から PHP 5 への移行
xieoy at hotmail dot com
29-Aug-2007 02:09
I am using PHP5.2.2 for winXP.
today, I downloaded php-4.4.7-Win32 here, and clicked php.exe and go-pear.bat.
I didnt understand what happened, then I just closed two 
windows.
But, to my surprise, my web which worked succesful on my computer doesn't work now, it disabled to connect mysql!!!!

Then I uninstalled PHP5.2.2,and installed again, but it doesnt work either!!!!!!!!!!!!!!!!!!!!!!!!!!!

why????????????

(windowsXP+PHP5.2.2+Mysql5+Apache2.2.4)
gfrank at neoservers dot com
25-Jun-2007 12:17
To get PHP5 and PHP4 to work at the same time you will also need to change all "php_value", "php_flag", "php_admin_flag", and "php_admin_value" occurences; otherwise, you can't set configuration file settings.
odnowa-sql at o2 dot no-spam pl
29-Apr-2007 09:13
You can run PHP4 and PHP5 as Apache2 modules at the same time. The trick is to hack the sources a little bit.
Change all occurences of application/x-httpd-php (and MIME type for sources) to application/x-httpd-php5 and then add that mime type to apache conf.

 
show source | credits | sitemap | contact | advertising | mirror sites