Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

Do anyone know how to integrate Sharepoint and Php. I am trying to develop php app which can connect to Sharepoint.In particular since basically I am website developer, I want my all websites to be connected with Sharepoint. So, simply I want to create Php app such that it works for all the websites. I don't know is it possible or not but I want to give it a try but don't know how to proceed.

Any idea/suggestions is welcome.

Thanks in advance.

share|improve this question
 
Possible dup: stackoverflow.com/questions/7782645/… –  ckhan Jul 9 '13 at 10:28
 
@ ckhan thank you for the link but first of all i want to connnect php to sharepoint before i work with database.I already have a sharepoint in server, Now i want to connect that sharepoint with some php app in my computer. –  sammy Jul 9 '13 at 10:40
add comment

2 Answers

If I read your question right, you want to interact with your SharePoint site using PHP. You can do most interaction by using SharePoint's web services. For instance, you can read all list items using the lists web service (http:///_vti_bin/lists.asmx). You can upload files to a SharePoint document library. I searched furiously for an example of what I did to accomplish that, but I have lost it. I remember using Curl to do the uploads.

There are a number of websites that discuss using PHP to access SharePoint data. Here are a couple that I found with a simple google search:

As well as a discussion about a tool called Camelot PHP here

share|improve this answer
 
@ robbert yes i want to interact with sharepoint site using php but before that i think i need to make a connection between the two. Reading list items, uploading can only be done when i make a connection between the two, isn't it?? Right now I am confused about how to connect php with sharepoint. –  sammy Jul 10 '13 at 4:22
1  
Probably your best best, as suggested above, is to use the RESTful services surfaced by SharePoint, try: mstecharchitect.blogspot.com/2010/01/… –  mezmo Jul 10 '13 at 14:53
 
I've added some links to sites discussion a solution. It can be done. –  Robbert Jul 10 '13 at 15:20
 
@ robbert thanks for the links ... I ma going through it and I believe it will be helpful. :) –  sammy Jul 11 '13 at 4:37
add comment

Try this API

In SharePoint

Download the WSDL. Usually at this location: <sharepoint.url>/subsite/_vti_bin/Lists.asmx?WSDL

Download the API

Make sure to save both SoapClientAuth.php and SharePointAPI.php

In PHP

// 0: include api in your php script.
require_once('SharePointAPI.php');

// 1: connect to SharePoint
$sp = new SharePointAPI('<username>', '<password>', '<path_to_WSDL>');

// 2: read a list
$listContents = $sp->read('<list_name>'); 

// 3: now you have a 2-D array to work with in PHP
foreach($listContents as $item)
{
    var_dump($item);
}

With this API, you can also query, update, create, delete lists, query list metadata

share|improve this answer
 
Yours seems to be a nice answer, but I get at $listContents = $sp->read('<list_name>'); , Unauthorized error. Any idea why ? –  HeinrichStack Dec 5 '13 at 11:28
 
are you using NTLM? try $sp = new SharePointAPI('<username>', '<password>', '<path_to_WSDL>', true); Notice the last parameter true. –  sshen Dec 5 '13 at 22:58
 
no, unfortunately I don't use NTLM. Any other suggestions ? –  HeinrichStack Dec 6 '13 at 10:01
 
give this tool a try. enter your credentials and name of the list. be caseful with casing and spaces. spcamlqueryhelper.codeplex.com –  sshen Dec 6 '13 at 17:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.