Source of: /manual/en/faq.migration5.php
<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/faq.inc";
$setup = array (
'home' =>
array (
0 => 'index.php',
1 => 'PHP Manual',
),
'head' =>
array (
0 => 'UTF-8',
1 => 'en',
),
'this' =>
array (
0 => 'faq.migration5.php',
1 => 'Migrating from PHP 4 to PHP 5',
),
'up' =>
array (
0 => 'faq.php',
1 => 'FAQ: Frequently Asked Questions',
),
'prev' =>
array (
0 => 'faq.languages.php',
1 => 'PHP and other languages',
),
'next' =>
array (
0 => 'faq.misc.php',
1 => 'Miscellaneous Questions',
),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);
manual_header();
?>
<div>
<h1>Migrating from PHP 4 to PHP 5</h1>
<p class="para">
This faq section will help you migrate from PHP 4 to PHP 5.
</p>
<div class="qandaset"><ol class="qandaset_questions"><li><a href="#faq.migration5.php45">
Migrating from PHP 4 to PHP 5
</a></li><li><a href="#faq.migration5.mysql">
Does MySQL work in PHP 5? It seemed to have disappeared.
</a></li><li><a href="#faq.migration5.oop">
I hear PHP 5 has an entirely new OOP model, will my existing OOP code
work? Where do I find information on these new OOP features?
</a></li><li><a href="#faq.migration5.changes">
So besides the new OOP model, what else has changed in PHP 5? Also, is
there a PHP 5 specific version of the PHP manual?
</a></li></ol>
<dl>
<dt><strong>
<p class="para">
Migrating from PHP 4 to PHP 5
</p>
</strong></dt>
<dd><a name="faq.migration5.php45"></a>
<p class="para">
Although PHP 5 offers many new features, it's designed to be as
compatible with earlier versions of PHP as possible with little
functionality being broken in the process.
</p>
<p class="para">
Be sure to read the appropriate <a href="migration5.php" class="link">PHP 5
migration appendix</a> of this manual as it contains even more
information on the topic of migrating to PHP 5.
</p>
</dd>
</dl>
<dl>
<dt><strong>
<p class="para">
Does MySQL work in PHP 5? It seemed to have disappeared.
</p>
</strong></dt>
<dd><a name="faq.migration5.mysql"></a>
<p class="para">
<a href="ref.mysql.php" class="link">MySQL</a> is supported with the only
change being that MySQL support is no longer enabled by
<em class="emphasis">default</em> in PHP 5. This essentially means that
PHP doesn't include the <span class="option">--with-mysql</span>
option in the <a href="configuration.php" class="link">configure</a> line so
that you must now manually do this when compiling PHP. Windows users will
edit <var class="filename">php.ini</var> and enable the <var class="filename">php_mysql.dll</var> DLL as
in PHP 4 no such DLL existed, it was simply built into your Windows
PHP binaries.
</p>
<p class="para">
Also, the MySQL client libraries are no longer bundled with PHP. More
details on this topic are covered in
<a href="faq.databases.php#faq.databases.mysql.php5" class="link">the following FAQ</a> and
be sure to read the <a href="ref.mysql.php" class="link">MySQL section</a>
for details on installing MySQL. An example configure line would be
<span class="option">--with-mysql=/usr</span> while Windows users
will need the <var class="filename">libmySQL.dll</var> available to the system.
</p>
</dd>
</dl>
<dl>
<dt><strong>
<p class="para">
I hear PHP 5 has an entirely new OOP model, will my existing OOP code
work? Where do I find information on these new OOP features?
</p>
</strong></dt>
<dd><a name="faq.migration5.oop"></a>
<p class="para">
The main change in PHP 5 is to the OOP model as PHP 5 now uses
the <em class="emphasis">Zend Engine 2.0</em>. The <a href="ini.core.php#ini.zend.ze1-compatibility-mode" class="link">
zend.ze1_compatibility_mode</a> directive enables compatability
with the <i>Zend Engine 1.0</i> (PHP 4).
</p>
<p class="para">
The new OOP model is documented in the <a href="language.oop5.php" class="link">
OOP language reference</a> and <a href="migration5.oop.php" class="link">OOP
migration appendix</a> sections.
</p>
</dd>
</dl>
<dl>
<dt><strong>
<p class="para">
So besides the new OOP model, what else has changed in PHP 5? Also, is
there a PHP 5 specific version of the PHP manual?
</p>
</strong></dt>
<dd><a name="faq.migration5.changes"></a>
<p class="para">
Few other changes exist, see the <a href="migration5.php" class="link">migration
5 appendix</a> for details. There won't be a PHP 5 specific
version of the manual as the bulk of PHP remains the same.
</p>
</dd>
</dl>
</div>
</div>
<?php manual_footer(); ?>