Installing the Alfresco PHP Library on Windows
May 23rd, 2006
I was helping a customer out with configuring the Alfresco PHP Web Services API on a Windows XP environment today and figured others might be interested in learning how to do it themselves.
Please forgive the ugly formatting.
1. These instructions assume you’re installing on IIS running on Windows XP.
2. Download the latest Alfresco PHP Client Library from http://dev.alfresco.com/downloads
3. Pick up the following PHP archives for Windows from http://www.php.net/downloads.php
a. http://www.php.net/get/php-5.1.4-Win32.zip/from/a/mirror
b. http://www.php.net/get/php-5.1.4-installer.exe/from/a/mirror
4. Unzip the Alfresco PHP Client Library to c:\Alfresco\php_lib
5. Install the PHP installer EXE to the default location of C:\PHP
a. Accept defaults and choose the appropriate IIS version (IIS 4.x and above on XP).
6. Unzip the PHP ZIP file over C:\PHP this will add some additional components.
7. From the Windows Explorer go to C:\PHP and run PEAR_ENG.reg by double-clicking it. Accept the prompts.
8. Open a command prompt at go to C:\PHP
a. Run “go-pear.bat” and accept all defaults by pressing “Enter”.
b. Once PEAR is installed run the following:
i. pear install –alldeps channel://pear.php.net/SOAP-0.9.4
ii. pear install –alldeps channel://pear.php.net/Net_DIME-0.3
9. Open PHP.ini:
a. The default location for PHP.ini is C:\Windows
b. Search for the string “include_path” and add the following in the next empty line:
include_path=”.;C:\PHP\PEAR;c:\Alfresco\php_lib”
c. Add the following to the very end of the file (note that the alfresco.server value must be consistent with your installation:
[alfresco]
; Alfresco server location
alfresco.server=http://localhost:8080
10. Open c:\Alfresco\php_lib\alfresco\webservice\WebServiceUtils.php
a. Replace the following lines with the ones that follow in step ‘b’:
$createdDate = date(”Y-m-d\TH:i:s\Z”);
$expiresDate = date(”Y-m-d\TH:i:s\Z”, mktime(date(”H”)+1, date(”i”), date(”s”), date(”m”), date(”d”), date(”Y”)));
b. Use these values:
$createdDate = date(”Y-m-d\TH:i:s\Z”, mktime(date(”H”)+24, date(”i”), date(”s”), date(”m”), date(”d”), date(”Y”)));
$expiresDate = date(”Y-m-d\TH:i:s\Z”, mktime(date(”H”)+25, date(”i”), date(”s”), date(”m”), date(”d”), date(”Y”)));
c. Save the file.
11. Copy the c:\Alfresco\php_lib\examples folder to c:\Inetpub\wwwroot\ (or wherever IIS’s home directory is set to).
12. You may need to restart IIS. You can do so from the Service Manager.
13. Open your browser and point it to http://localhost/examples/simple/simple.php
a. You should see output like this:
A list of all the items in company home and their descriptions:
Data Dictionary User managed definitions
Guest Home The guest root space
Entry Filed under: Alfresco, Hints and Tips

1 Comment Add your own
1. Eko SW | July 7th, 2006 at 8:10 pm
Well, I am not a PHP coder after all. Only a little.
I should leave this part of cool PHP stuff to my colleagues.
Thanks a lots for the tips,
you know it is a no brainer,
but really really helpfull for some who research it.
May THE GOD be with you!!!
Leave a Comment
You must be logged in to post a comment.
Trackback this post | Subscribe to the comments via RSS Feed