faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

14 of 20 people (70%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How portable is php across browser and server platforms?

Feb 29th, 2008 10:10
dman, John Lim, Narendra Jain, Lorraine Nicol, Ben Udall, http://www.ttnr.org


In general PHP is quite portable. How are some of the minor issues i 
have faced.
1. PHP is still a changing language. There are minor differences 
between different PHP releases. For example, include_once is only 
available from PHP4.0 patch level 1.
2. You have to be  aware of differences in behaviour between Apache and 
other web servers. For example, certain server variables available in 
Apache are not available in IIS and vice versa.
3. PHP.INI settings on different servers can cause big differences in 
handling of global variables and what the PHP program accepts as legal 
PHP code.
4. Make sure all PHP extensions are compiled consistently. Some PHP web 
sites lack certain key extensions, or have old versions of certain 
extensions.
5. PHP requires the use of a Database Wrapper Library for portability 
as different APIs are used for accessing different databases. May I 
suggest ADODB (I am the author). It is available at
     http://php.weblogs.com/adodb
6. There was a big change between PHP 4.1.2 and PHP 4.2.0. The default 
install now turns off register_globals, so your post, get, cookie 
variables are not in the global namespace by default since 4.2.0. Of 
course you can access the variables from $_POST, $_GET, $_COOKIES or 
the old $HTTP_*_VARS arrays.
- John Lim
If you program correctly, i.e. taking care of browser types and
versions, the php codes are portable across Web Browsers. There are some
changes which might be needed for Windows based and Unix / Linux based
server platforms.