Wednesday, September 30, 2009
Microsoft promotes the careers of PHP professionals!
This article presents an interview with a Microsoft manager to explain in more details what is this initiative and how the PHP professionals may take advantage of it.
Click the below link to view more info.
http://www.phpclasses.org/blog/post/102-Microsoft-promotes-the-careers-of-PHP-professionals.html
Thursday, January 22, 2009
Prepare for ZEND Certificed Engineer
http://saidur.wordpress.com/2008/12/05/how-to-preapre-for-zend-php5-certification-exam/
Tuesday, October 14, 2008
PHP Object-Relational Mapping: ORM or ROM?
For More information : http://www.phpclasses.org/blog/post/82-PHP-ObjectRelational-Mapping-ORM-or-ROM.html
Saturday, October 4, 2008
Php value configuration in .htaccess
There are some php language settings that must be set for phpWebSite to function correctly. It is not our job here to survey every php runtime configuration setting. That is the job of the php on-line manual http://us3.php.net/manual/en/configuration.php. What this part of the guide strives to do is show you the settings that may make most new phpWebSite installations stumble when they are not set correctly. You must adjust these settings in the php.ini file. This is the primary place to make the changes. There are several other ways to make these changes should your site be supported by a web hosting company. Knowledge of these settings is helpful when you have to raise a support ticket with your selected web hosting company or if you have a Linux admin supporting you. It may be helpful to ask about these paramenters in a pre-sales question with a potential web hosting company. Their answers may help you decide to choose another company.
There are three ways to set these parameters. One is the php.ini file. A typical Linux distribution will place this file in /etc/php.ini,. The second way to set these values is by using the Apache .htaccess file that you can store in your phpWebSite Root directory. The third and final way to set these parameters is programmatically through the phpWebSite Core.php file. The file can be found in phpWebSite Root/core/Core.php.
Missing image
Warning.png
Warning
You should decide on one of the three different ways of setting these values. You will have to use your best judgement because each php runtime environment that phpWebSite can be installed in has its own variations. Take these settings as a general guideline for how to configure php in your web server's environment.
php.ini
In this section the runtime configuration parameters are examined in depth as far as phpWebSite is concerned.
Missing image
Caution.png
Caution
Note that setting the configuration parameters in the php.ini file will affect all the other php applications on the same server. A missconfiguration in one of these values will torpedo your whole site not to mention phpWebSite.
Missing image
Warning.png
Warning
As noted with the other two ways of making these changes you should only pick one of these and use it alone.
include_path
This is one of the most important configuration parameters to set for phpWebSite. Please review the phpWebSite Onion. phpWebSite implementations use include_path to set the php language path to include the phpWebSite Root/lib/pear library that is shipped with each phpWebSite release. You will want to edit the include_path , if you are having problems.
Missing image
Caution.png
Caution
Most new users struggle with this at first. An example error might be: "When I get to Step 4 to load http://www.yourdomain.edu/setup, I get the following error: "
Warning: main(../core/Core.php) [function.main]: failed to create stream:
Permission denied in /user2/rwj/public_html/phpws/setup/index.php on line 9
Fatal error: main() [function.main]: Failed opening required '../core/Core.php'
(include_path='.:/usr/local/php-4.3.1/lib/php') in /user2/rwj/public_html/phpws/setup/index.php on line 9
There are three things that are useful to have in the include_path. They are
* The dot ( . ) directory. The dot directory is also known as the current working directory.
* The pear library path that you will be using with your phpWebSite implementation. This will be phpWebSite Root/lib/pear/. As noted in other places, phpWebSite Root will vary from site to site depending on how you are hosting phpWebSite.
* The location of all the standard php system code. This could be /usr/lib/php or if your site is in transition to another version of the php language, then the site administrator may have installed your __stable__ version of the php language as /usr/lib/php4 . Putting all these considerations together your path should look something like the following. Also note that a colon ( : ) is required to separate all the values that we need assign to the include_path setting.
include_path = ".:phpWebSite Root/lib/pear/:/usr/lib/php4"
Please see http://us3.php.net/manual/en/ini.sect.path-directory.php#ini.include-path for more information.
The "failed to create stream: Permission denied" error message in the above example is the perfect segway into the session.save_path setting. Misconfigured settings for both the include_path and session.save_path settings may harmoniously blow up in your face together.
session.save_path
Session information is created for each person that hits your site. You should handle this variable with security concerns in mind. That being said the session.save_path can have a wide range of values. These may range from a simple directory like /tmp to special directories like /var/lib/php/session depending on your Linux distribution's philosophy. A web hosting company may create a special directory for this depending on their philosophy. A web hosting company's automated account creation scripts may place this directory some where in your account's web files directory.
Additional ideas govern the values stored in this setting. Let's say you set session.save_path to /tmp. Well you need to make sure the /tmp directory is located on a disc drive that has space. In addition, this directory should be writable by the web server. Periodic maintenance is also required on this directory. If you have a bizillion files in this directory, php may experience problems. This is not just a php issue. Other applications can perform poorly, if the temporary directory used to save working files is full of old files. After noting security concerns, space limitation, the php application mix on your server, and your determination to monitor the number of files in the directory that you are going to set this value to, then you may decide on /var/lib/php/session as the correct value.
session.save_path = /var/lib/php/session
Please see http://us3.php.net/manual/en/ref.session.php#ini.session.save-path for more information. The session.save_handler parameter may also come into play http://bugs.php.net/bug.php?id=25876. You may also want to consult your Linux distribution's documentation.
phpWebSite failed a session test. If your PHP installation is not configured to allow sessions,
you will not be able to run phpWebSite. Please check your session path in your php.ini file
and make sure your version of php supports superglobals(greater than version 4.1.2)
Missing image
Note.png
Image:Note.png
Note that only one of many session variables have been covered. Some of the other session.* settings may help you resolve problems. The related parameters all start with session. Hence, the session.* notation. A few of these session problems are may be answered in the Session Related Issues page. An example session configuration error message related to incorrect session.* settings is shown above. Special thanks go to sourceForge user akumaish for posting a response to this error message in the phpWebSite forums
Still having problems? Please review this short summary of trouble shooting ideas that were covered in this section.
1. Have you configured session.save_path to begin with in your php.ini file?
2. Do you have the correct directory for Linux or MS Windows? /tmp or C:\tmp.
3. Does the directory exist? /tmp or C:\tmp
4. Does the directory have read and write permissions for your webserver software--apache--to the temporary directory created for the session files?
5. After many days, weeks, of months of use, have you deleted old session files?
6. Do you have enough disk space available for the session files? If the disk drive where your temporary file is located runs out of space, then you will receive the "failed a session test" error. Having no disk space is just like not having created a temporary directory to store the files or having the correct permissions on the directory.
Path Summary
So far several sections of this page have covered information about correctly setting paths. Problems can arise on a correctly configured and working phpWebSite installation. Typical problems occur when key server software are upgraded. Typically the php.ini settings that cover paths that have been configured above should be rechecked if your site starts experiencing problems. Here's an example from a real life forum post:
* "I have changed my site URL but I now get an error message telling me the file is not in the "allowed path(s)." The error message is surprising as the path so far as I know has been removed. The conf/config.php file has been correctly modified. There must be some place that the script is still getting the old path information from. Can anybody help me figure where the next change should be?" (https://sourceforge.net/forum/message.php?msg_id=3824049)
* One proposed solution looked at the openbasedir php configuration settings. (https://sourceforge.net/forum/message.php?msg_id=3824145)
* Even though the openbasedir setting was not the answer, the answer provided a catalyst for a possible place to look: "The 'allowed paths' message refers to the hard-coded paths in your php.ini file. The php.ini settings were created initially by a wizard set-up by the ISP. The ISP allows me access to edit these settings as I'm running PHP in CGI mode. The "allowed path(s) problem is all sorted now, so thanks for the spark needed to solve the problem!" (https://sourceforge.net/forum/message.php?msg_id=3824224)
This real life story provides an example of how your functioning phpWebSite can start failing on you for no apparent and obvious reason. If your phpWebSite becomes important to you or others, then this is the time to look at both the Trouble Shooting With phpInfo page and Planning The Installation page. Write the settings of your site down now in a disciplined fashion before the installation, during the installation, or immediately after the installation. The information may not look important now but may be vital to your site's recovery when your Web hosting company pulls the rug out from under you! In this example, these two configuration pages would provide you with a before the problem occurred configuration and after the problem started configuration page. The "after the problem started configuration page" would be developed by using phpInfo.
Special thanks go to SourceForge user mb__mart, Malcolm, for posting back information on the solution to the "allowed path(s)" problem.
memory_limit
The Memory section of the Official Requirements part of this document provides some sample values. After you consult the memory table you may decide on 12M as the correct value. You would then edit your php.ini with this value.
memory_limit = 12M
Trial and error may be required to find the right value depending on the limitations of your phpWebSite installation environment. As noted in the memory table the number of modules that you Boost with the core phpWebSite system will greatly affect how this parameter should be set. If the value in the memory_limit parameter is set too low, then you will receive fatal runtime error messages
Fatal error: Allowed memory size of m bytes exhausted (tried to allocate e bytes) in Unknown on line n
* where m is the the memory limit the was exhausted.
* where e is the number of bytes that the memory limit was exceed by.
* where n is the line number in the phpWebSite system code where the php memory limit setting was exhausted.
The author of this section, Dr kludge, has had to use 16M so that the php squirrel mail application would function properly. Additional information can be found in the phpWebSite official FAQ http://phpwebsite.appstate.edu/index.php?module=faq&FAQ_op=view&FAQ_id=18. Please also see http://us3.php.net/manual/en/ini.sect.resource-limits.php#ini.memory-limit for more information.
max_execution_time
There are times when you will need to adjust max_execution_time. There have been times in past phpWebSite release cycles that this value had to be increased. Start with the default value of 30 first. Some users have set this as high as 120.
max_execution_time = 30
Please see http://us2.php.net/manual/en/ref.info.php#ini.max-execution-time for more information.
max_input_time
There are times when you will need to adjust max_input_time. Start with the default value of 60 first.
max_input_time = 60
Please see http://us3.php.net/manual/en/ref.info.php#ini.max-input-time for more information.
etc.magic_quotes_runtime
This is a setting required on some Linux distributions. You may need to set this value to Off if it was set to On.
etc.magic_quotes_runtime = Off
Please see http://phpwebsite.appstate.edu/index.php?module=faq&FAQ_op=view&FAQ_id=187 or http://us3.php.net/manual/en/ref.info.php#ini.magic-quotes-runtime for more information.
safe_mode_allowed_env_vars
This may be a useful setting when safe mode is set. You may need to set this value to TZ if you are having problems with safe_mode operation of your phpWebSite system.
safe_mode_allowed_env_vars = TZ
Please see http://us4.php.net/features.safe-mode or http://us4.php.net/manual/en/features.safe-mode.php#ini.safe-mode-allowed-env-vars for more information.
Restart The Web Server
I'll put this important reminder in the php.ini section. Anytime that you make a /etc/php.ini setting change, then you must restart the web server. Now friends and countryman, your author, would like to save you some embarassment. Yes friends there have been times when yours truely has made changes to the /etc/php.ini and has been pounding his head against the wall. The php.ini file changes were not working as advertised. Not only was he angry X-( and red faced :o he now can share those wonderful stories from the school of hard knocks with you. :\ Anytime that you make changes to your /etc/php.ini file and your web service is running, please issue this command.
su - root -c "/etc/rc.d/init.d/httpd restart"
Yep. The sample restart command is based off of a Red Hat Linux distribution. You should be able to find how to perform this command on your Linux distribution based on the example given. Missing image
Note.png
Note
Note: You will not have to perform this step for the other two php language environment configurations. Those options are dynamic because each option is evaluated each time your site is accessed.
Apache .htaccess File
This is the second example of how to configure your php language environment.
Missing image
Warning.png
Warning
As noted with the other two ways of making these changes you should only pick one of these and use it alone.
Normally, the Apache web server uses an httpd.conf file to store all of its settings. A Linux distribution may create the file in /etc/httpd/conf directory. This file and the rest of the /etc directory contents are off limits to most users on a Linux system except for the root user. The Apache software development team has created another mechanism to allow a user in a web hosting company supported environment to change some of the web server settings. This flexibility may be turned off or on as the web hosting company sees fit. Speaking of flexibility, an .htaccess file comes with a cost. The .htaccess file has to be parsed by the Apache web server each time a file is served out of the directory covered by one of these files. This may be be the perfect solution for configuring the php language when a web hosting company is involved. On the one hand, they will not let you edit the /etc/php.ini file. On the other hand, the WebHostingCompany may not let php application code use the ini_set(); function. So we will happly embrace the performance hit so that we can access all the power that the phpWebSite CMS provides our new site.
include_path
php_value include_path ".:PhpWebSiteRoot/lib/pear/:/usr/lib/php4"
session.save_path
php_value session.save_path "/tmp"
memory_limit
php_value memory_limit "12M"
max_execution_time
php_value max_execution_time "30"
max_input_time
php_value max_input_time "60"
etc.magic_quotes_runtime
php_value etc.magic_quotes_runtime "Off"
safe_mode_allowed_env_vars
php_value safe_mode_allowed_env_vars "TZ"
A Sample .htaccess File
php_value arg_separator.output "&"
php_value arg_separator.input "&"
php_value include_path ".:PhpWebSiteRoot/lib/pear/:/usr/lib/php4"
php_value session.save_path "/tmp"
php_value memory_limit "12M"
php_value max_execution_time "30"
php_value max_input_time "60"
php_value etc.magic_quotes_runtime "Off"
Programmatically Setting php.ini Values
This is the third and last example of how to configure your php language environment.
Missing image
Warning.png
Warning
As noted with the other two ways of making these changes you should only pick one of these and use it alone.
Information on the ini_set() function is located here http://us3.php.net/manual/en/function.ini-set.php. The php.ini section went into the details on each of these values. The only difference here is how the value is changed. For example memory_limit = 12M in the php.ini section will not be coded as ini_set("memory_limit", "12M");. You will want to add these ini_set() function calls to the Core.php program file. phpWebSite will dynamically set these values during the execution of the Core.php file. You can find this file in here phpWebSite Root/core/Core.php. The file may be all that you will have to modify when configuring the php language. Missing image
Note.png
Note
Note dynamic settings proposed in this section of the document may not be supported on your web server.
include_path
The only real comment to make here concerns the PHPWS_SOURCE_DIR part of the path. The Access The Setup URL section talks about the initial configuration file. As part of entering data in this first screen you will provide the phpWebSite Root directory information. For all intents and purposes the phpWebSite Root information that you supply via the setup screen will be stored in the PHPWS_SOURCE_DIR variable. The rest of the phpWebSite system will use this value. All of the code will function properly or die splendidly based on your thoughtful understanding of what phpWebSite Root means for your site. __Your judgement is crucial here!__
ini_set("include_path", ".:" . PHPWS_SOURCE_DIR . "lib/pear/:/usr/lib/php4");
session.save_path
ini_set("session.save_path", "/tmp");
memory_limit
ini_set("memory_limit", "12M");
max_execution_time
ini_set("max_execution_time", "30");
max_input_time
ini_set("max_input_time", "60");
etc.magic_quotes_runtime
ini_set("etc.magic_quotes_runtime", "Off");
safe_mode_allowed_env_vars
ini_set("safe_mode_allowed_env_vars, "TZ");
-------------
Friday, October 3, 2008
Seven habits for writing secure PHP applications
Increase the security of your Web applications
Security in a PHP application includes remote and local security concerns. Discover the habits PHP developers should get into to implement Web applications that have both characteristics.
When it comes to security, remember that in addition to actual platform and operating system security issues, you need to ensure that you write your application to be secure. When you write PHP applications, apply these seven habits to make sure your applications are as secure as possible:
Validate input
Guard your file system
Guard your database
Guard your session data
Guard against Cross-Site Scripting (XSS) vulnerabilities
Verify form posts
Protect against Cross-Site Request Forgeries (CSRF)..
More use full information available @ www.ibm.com
Wednesday, September 3, 2008
php Subtract the Time
function subtractTime($hours=0, $minutes=0, $seconds=0, $months=0, $days=0, $years=0)
{
$totalHours = date("H") - $hours;
$totalMinutes = date("i") - $minutes;
$totalSeconds = date("s") - $seconds;
$totalMonths = date("m") - $months;
$totalDays = date("d") - $days;
$totalYears = date("Y") - $years;
$timeStamp = mktime($totalHours, $totalMinutes, $totalSeconds, $totalMonths, $totalDays, $totalYears);
$myTime = date("Y-m-d H:i:s A", $timeStamp);
return $myTime;
}
// Let us first see the current time
echo "Current Time:" . date("Y-m-d H:i:s A");
echo "<BR>";
// Now let us deduct 5 hours, 2 days and 1 year from now
echo "New Time: " .subtractTime(0,15,0,2,0,0);
?>
Friday, July 11, 2008
New Object Oriented Features in PHP5
New Object Oriented Features
The new object oriented features are too numerous to give a detailed description in this section. The object oriented language chapter goes over each feature in detail.
The following is a list of the main new features:
1. public/private/protected access modifiers for methods and properties
Allows the use of common OO access modifiers to control access to methods and properties.
class MyClass { |
2. Unified constructor name __construct()
Instead of the constructor being the name of the class, it should now be declared as __construct(), making it easier to shift classes inside class hierarchies.
class MyClass { |
3. Object destructor support by defining a __destructor() method
Allows defining a destructor function that runs when an object is destroyed.
<?php |
4. Interfaces
Gives the ability for a class to fulfill more than one is-a relationships. A class can inherit from one class only but may implement as many interfaces as it wants.
interface Display { |
5. instanceof operator
Language level support for is-a relationship checking. The PHP 4 is_a() function is now deprecated.
if ($obj instance of Circle) { |
6. final methods
The final keyword allows you to mark methods so that an inheriting class can't overload them.
class MyClass { |
7. final classes
After declaring a class as final, it can't be inherited. The following example would error out:
final class FinalClass { |
8. Explicit object cloning
In order to clone an object you have to use the clone keyword. You may declare a __clone() method which will be called during the clone process (after the properties have been copied from the original object).
class MyClass { |
9. Class constants
Classes definitions can now include constant values, and are referenced using the class.
class MyClass { |
10. Static members
Classes definitions can now include static members (properties), accessible via the class. Common usage of static members is in the Singleton pattern.
class Singleton { |
11. Static methods
You can now define methods as static allowing them to be called from non-object context. Static methods don't define the $this variable as they aren't bound to any specific object.
<?php |
12. abstract classes
A class may be declared as abstract so as to prevent it from being instantiated. However, you may inherit from an abstract class.
abstract class MyBaseClass { |
13. abstract methods
A method may be declared as abstract, thereby deferring its definition to an inheriting class. A class that includes abstract methods must be declared as abstract.
abstract class MyBaseClass { |
14. Class type hints
Function declarations may include class type hints for their parameters. If the functions are called with an incorrect class type an error occurs.
function expectsMyClass(MyClass $obj) { |
15. Support for dereferencing objects which are returned from methods.
In PHP 4, you could not directly dereference objects which are returned from methods. You would have to first assign the object to a dummy variable and then dereference it.
PHP 4:
$dummy = $obj->method(); |
PHP 5:
$obj->method()->method2(); |
16. Iterators
PHP 5 allows both PHP classes and PHP extension classes to implement an Iterator interface. Once you implement this interface you will be able to iterate instances of the class by using the foreach() language construct.
$obj = new MyIteratorImplementation(); |
For a more complete example, please refer to the "Advanced OOP & Design Patterns" chapter.
17. __autoload()
Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class). In PHP 5, this is no longer necessary. You may define an __autoload() function which is automatically called in case you are trying to use a class which hasn't been defined yet. By calling this function the scripting engine is giving a last chance to load the class before PHP bails out with an error.
function __autoload($class_name) { |
Other New Language Features
1. Exception handling
PHP 5 adds the ability for the well known try/throw/catch structured exception handling paradigm. You are only allowed to throw objects which inherit from the Exception class.
class SQLException extends Exception { |
Currently for backwards compatibility purposes most internal functions do not throw exceptions. However, new extensions are making use of this capability and you can use it in your own source code. Also, similar to the already existing set_error_handler() you may use set_exception_handler() to catch an unhandled exception before the script terminates.
2. foreach with references
In PHP 4, you could not iterate through an array and modify its values. PHP 5 supports this by allowing you to mark the foreach() loop with the & (reference) sign, thus making any values you change affect the array you're iterating over.
foreach ($array as &$value) { |
3. default values for by-reference parameters
In PHP 4, default values could only be given to parameters which are passed by-value. Giving default values to by-reference parameters is now supported.
function my_func(&$arg = null) { |
General PHP changes
XML and Web Services
Following the changes in the language, the XML updates in PHP 5 are most probably the most significant and exciting. The enhanced XML functionality in PHP 5 puts it on par with other web technologies in some areas and overtakes them in others.
The Foundation
XML support in PHP 4 was implemented using a variety of underlying XML libraries. SAX support was implemented using the old Expat library, XSLT was implemented using the Sablotron library (or using libxml2 via the DOM extension) and DOM was implemented using the more powerful libxml2 library by the GNOME project.
Using a variety of libraries did not make PHP 4 excel when it came to XML support. Maintenance was poor, new XML standards weren't always supported, performance wasn't as good as it could have been, and interoperability between the varies XML extensions did not exist.
In PHP 5, all XML extensions have been rewritten to use the superb libxml2 XML toolkit (http://www.xmlsoft.org/). It is a very feature rich, highly maintained and efficient implementation of the XML standards bringing the cutting edge of XML technology to PHP.
All the above mentioned extensions (SAX, DOM and XSLT) now use libxml2 including the new additional extensions SimpleXML and SOAP.
SAX
As mentioned, the new SAX implementation has switched from using Expat to libxml2. Although the new extension should be compatible there may be some small subtle differences. Developers who still want to work with the Expat library can do so by configuring and building PHP accordingly (not recommended).
DOM
Although DOM support in PHP 4 was also based on the libxml2 library, it was quite buggy, had memory leaks and the API in many cases was not W3C compliant. The DOM extension went through a thorough facelift for PHP 5. Not only was the extension mostly rewritten it is now also W3C complaint. For example, function names now use studlyCaps as described by the W3C standard making it easier for you to read general W3C documentation and implementing what you learnt, right away in PHP. In addition, the DOM extension now supports three kinds of schemas for XML validation, DTD, XML Schema and RelaxNG.
As a result of these changes PHP 4 code using DOM will not always run in PHP 5. However, in most cases adjusting the function names to the new standard will probably do the trick.
XSLT
In PHP 4, there were two extensions that supported XSL Transformations. The first was using the Sablotron extension and the second was using the XSLT support in the DOM extension. In PHP 5, a new XSL extension was written and, as mentioned, is based on the libxml2 extension. As in PHP 5, the XSL Transformation does not take the XSLT stylesheet as a parameter but depends on the DOM extension to load it, the stylesheet can be cached in memory and may be applied to many documents saving execution time
SimpleXML
Probably when looking back in a year or two it will be clear that SimpleXML has revolutionized the way PHP developers work with XML files. SimpleXML could really be called "XML for Dummies". Instead of having to deal with DOM or even worse SAX, SimpleXML represents your XML file as a native PHP object. You can read, write or iterate over your XML file with ease accessing elements and attributes.
Consider the following XML file:
<clients> |
The following piece of code prints each client's name and account number:
$clients = simplexml_load_file('clients.xml'); |
It's obvious how simple SimpleXML really is.
And in case there is something advanced you need to do to your SimpleXML object which isn't supported in this lightweight extension, you can convert it to a DOM tree by calling dom_import_simplexml(), manipulate it in DOM and covert it back to SimpleXML using simplexml_import_dom(). Thanks to both extensions using the same underlying XML library switching between these two has been made a reality.
SOAP
Official native SOAP support in PHP 4 was lacking. The most commonly used SOAP implementation was PEAR's but as it was implemented entirely in PHP it could not perform as well as a built-in C extension. Other available C extensions never reached stability and wide adoption and, therefore, were not included in the main PHP 5 distribution.
SOAP support in PHP 5 was completely rewritten as a C extension and, although it was only completed at a very late stage in the beta process, it was incooperated into the default distribution due to its thorough implementation of most of the SOAP standard.
The following calls SomeFunction() defined in a WSDL file:
$client = new SoapClient("some.wsdl"); |
New MySQLi (MySQL Improved) extension
For PHP 5, MySQL AB (http://www.mysql.com) has written a new MySQL extension that allows you to take full advantage of the new functionality in MySQL 4.1 and later. As opposed to the old MySQL extension, the new one gives you both a functional and an object oriented interface so that you can choose what you prefer. New features supported by this extension include prepared statements and variable binding, SSL and compressed connections, transaction control, replication support and more...
SQLite extension
Support for SQLite (http://www.sqlite.org) was first introduced in the PHP 4.3.x series. It is an embedded SQL library which does not require an SQL server and is very suitable for applications which don't require the scalability of SQL servers or if you're deploying at an ISP who doesn't give you access to an SQL server. Contrary to what its name implies SQLite is very feature rich and supports transactions, sub-selects, views and large DB files. It is mentioned here as a PHP 5 feature because it was introduced so late in the PHP 4 series and as it takes advantage of PHP 5 by providing an object oriented interface and supporting iterators.
Tidy extension
PHP 5 includes support for the useful Tidy (http://tidy.sf.net/) library. It allows PHP developers to parse, diagnose, clean and repair HTML documents. The Tidy extension supports both a functional and an object oriented interface, and it's API uses the PHP 5 exception mechanism.
Perl extension
Although not bundled in the default PHP 5 package, the Perl extension allows you to call Perl scripts, use Perl objects and use other Perl functionality natively from within PHP. This new extension sits within the PECL (PHP Extension Community Library) repository a http://pecl.php.net/package/perl.
Other New Things in PHP 5:
New memory manager
The Zend Engine features a new memory manager. The two main advantages are better support for multi-threaded environments (allocations don't need to do any mutual exclusion locks) and after each request freeing the allocated memory blocks is much more efficient. As this is an underlying infra-structure change you will not notice it directly as the end-user.
Dropped support for Windows 95
Running PHP on the Windows 95 platform is not supported anymore due to it not supporting functionality which PHP uses. As Microsoft has officially stopped supporting it over a year ago the PHP development community decided that this is a wise decision.