Firstly, PHP has very little dependencies. It does not need any files copied to the system root as many installation instructions state (with the exception of certain PHP extensions).

PHP from the command line.

Usage: PHP [options] [-f] <file>[--][args...]
PHP [options] -r <code> [--] [args...]
PHP [options[ [-B <begin_code>] -R <code>[-E <end_code>] [--] [args...]
PHP [options] -B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
PHP [options] -- [args...]
-a Run interactively
-c <path>|<file> Look for PHP.ini file in this directory
-n No PHP.ini file will be used
-d foo[=bar] Define INI entry foo with value ‘bar’
-e Generate extended information for debugger/profiler
-f <file> Parse <file>.
-h This help
-i PHP information
-l Syntax check only ( lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-B <begin_code> Run PHP <begin_code> before processing input lines
-R <code> Run PHP <code> for every input line
-F <file> Parse and execute <file> for every input line
-E <end_code> Run PHP <end_code> after processing all input lines
-H Hide any passed arguments from external tools.
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z Load Zend extension <file>.
args… Arguments passed to script. Use — args when first argument starts with – or script is read from stdin

As we can see a number of options can be passed to PHP that manipulates the way PHP acts. This will allow us to define the location of PHP.ini, if defined at all or other parameters that maybe injected. Apache is also configurable in a manner that will allow us to choose the PHP version to run upon apache‘s execution. For Example placing the following in httpd.conf will allow you to choose the version of PHP to be executed with apache.

<ifdefine PHP-5.0.0RC1>
  LoadModule PHP5_module C:\PHP\Distributions\PHP-5.0.0RC1-Win32\PHP5apache.dll
</ifdefine>

<ifdefine PHP-5.0.0RC2>
  LoadModule PHP5_module C:\PHP\Distributions\PHP-5.0.0RC2\PHP5apache.dll
</ifdefine>

<ifdefine PHP-5.0.0RC3>
  LoadModule PHP5_module C:\PHP\Distributions\PHP-5.0.0RC3-Win32\PHP5apache.dll
</ifdefine>

Using ‘ apache.exe -D PHP-5.0.0RC3-Win32‘.

Note: IfDefine is case sensative, also ensure Capital D is used in the command line as lower case has a different function (-d directory initial value for ServerRoot & -D parameter define parameter for <ifdefine>).

If any failures occur at this point, there are two common reasons, firstly in early versions of PHP, version 4 requires PHP.ini & PHP4ts.dll. As so many installation manuals like to tell you DO NOT PLACE ANY FILES IN THE SYSTEM ROOT, the best way to encapsulate installations is by placing any required file in the root path of the PHP.exe location, if using CLI copy the (PHP4ts.dll or PHP5ts.dll) & PHP.ini to that directory.

The order for PHP is to locate required files is %system%, %system32%, %systemroot%, %apacheroot%, %phproot%; in the general order of the system variable %path%. I recommend the follow directory structure when installing PHP

cvs -d :pserver:cvsread@cvs.PHP.net:/repository checkout phpweb/distributions (extract all)

C:.
---PHP
    +---Distributions
        +---PHP-3.0.17-win32
        +---PHP-4.3.2-Win32
        +---PHP-4.3.3-Win32
        +---PHP-4.3.4-Win32
        +---PHP-4.3.5-Win32
        +---PHP-4.3.6-Win32
        +---PHP-4.3.7-Win32
        +---PHP-5.0.0RC1-Win32
        +---PHP-5.0.0RC2-Win32
        +---PHP-5.0.0RC3-Win32

For each, rename ‘PHP.ini-dist’ to ‘PHP.ini’ and if applicable copy ‘PHP.ini-dist’ & ‘PHP4ts.dll/PHP5ts.dll’ to the directory ‘cli’ as well as ammending ‘PHP.ini’ temp path to your systems temp. From each %rootphp% path you can configure that installation with its own customised ‘ini’. I recommend reading PHP directives at php.net. From this you can setup VirtualHosts, such as http://PHP4/, http://php5/ etc, which will make switching between PHP 3, 4 & 5 simple :) . Note: This is for development purposes and should not be used in a production enviroment.

  • Share/Bookmark

Extending on Wez Furlongs article at zend on Com… Firstly lets clear up a little introduction to ADSI and its relevance to Com.

Active Directory Service Interfaces (ADSI) abstracts the capabilities of directory services from different network providers in a distributed computing environment, to present a single set of directory service interfaces for managing network resources. Administrators and developers can use ADSI services to enumerate and manage the resources in a directory service, no matter which network environment contains the resource.

The following figure shows how ADSI fits into an application environment. Whether the application is written in Visual Basic, C/C++, VBScript, Microsoft JScript, or as a Web application using Active Server Pages, Active Directory Service Interfaces provide a clean and easy-to-use access to the underlying directory services without having to use the native network APIs.

Thats nice, but what can ADSI do?

ADSI exposes interfaces to automate common administrative tasks, such as adding users and groups, managing printers, and setting permissions on network resources. Administrators use Windows Management Instrumentation (WMI) to manage operating systems via Windows Management Instrumentation Query Language (WQL). WMI is a component of the Windows OS that is an industry initiative to develop a standard technology for accessing management information in an enterprise environment, which uses the Common Information Model (CIM) provider that represent systems, applications, networks, devices, and other managed components. Confused?

Through the use of these providers,..

  • winmgmts://
  • cim://
  • LDAP://
  • WinNT://
  • NDS://
  • NWCOMPAT://
  • More Providers

Some simple examples… Read the rest of this entry »

Recently I have been researching into multi-lingual content, admittedly I have never properly looked into the concepts of Internationalization and Localization (i18n, l10n) before. Whilst reading the ICU documents. I have realised there is a significant lack of support for i18n & l10n in PHP applications. Despite the controversy with enterprise PHP, and the contenders commonly mentioned eZ Systems & Interakt, they still have limited support despite weak attempts at globalization (g11n).

The problem with i18n is the broad complexity of the field. Whilst PHP may well be able to handle i18n, it does not mean that the database or repertoire can? With regard to PHP in particular, I find that we make far too many assumptions; In general, this is a pitfall in many programming languages, so it is not justified pin pointing PHP developers. Whilst those particular details are applicable to i18n, we essentially need to look at a complete solution as a whole, which computer-based translation is just part of a recipe for an efficient globalized product.

I had a fundamental problem when I looked into Internationalizing data, this was simply to do with structuring globalized content. It is relatively simple handling string literals, which can be placed in a database and normalized. However, binary data and other forms of media are not ideally placed in a database. As, such structuring this data is challenging with regard to replication. Do you categorize content by country or language; as a result, I have concluded that replication is unavoidable in this instance. Although the approach that Internationalized Components for Unicode has taken with resource bundling is in hindsight the best approach. Some key points:-

  • Keep Data Separate
  • Keep Data Small
  • Find the Best Available Data

Whilst, this would be ideal it is not a feasible to implement for a variety of reasons, so the only ideal is to mediate content and aid linguists with a form of mediation via computer-based translation. Lets try and open our eyes and develop higher level applications.

About this blog

I have been a developer for roughly 10 years and have worked with an extensive range of technologies. Whilst working for relatively small companies, I have worked with all aspects of the development life cycle, which has given me a broad and in-depth experience.