I'm using the SharePoint 2010 server. As far as I know PHP does not support NTLM. If I cache the WSDL XML how can I connect to SP2010? Would OAuth work?

Has anyone successfully used PHP to connect to the SharePoint server?


I have only seen user/password been used to connect to the services.


You have 2 options : the REST API and the old WebServices. Personnaly, I've never use PHP to connect to SharePoint, only Java, and it works like a charm.


Here is a very nice post by Vadim Gremyachev about connecting from PHP to SharePoint Online, for those that may be looking for it: http://blog.vgrem.com/2014/05/31/sharepoint-online-client-php/

Works like a charm.

  • 1
    Well the blog post is great, but it is for SP 2013 Online, not SP 2010 ON premise as in this example – Robert Lindgren Jul 1 '14 at 9:37

There are 3rd party scripts to use with NTLM, plenty on google. Take a look at nusoap.

nuSoap with NTLM example


Try this api: https://github.com/thybag/PHP-SharePoint-Lists-API

I have tried and it works perfectly. you can also find how to's of the api on same link.

include "Thybag\SharePointAPI.php";
include "Thybag\Auth\SharePointOnlineAuth.php";
include "Thybag\Auth\SoapClientAuth.php";
include "Thybag\Auth\StreamWrapperHttpAuth.php";
include "Thybag\Service\ListService.php";
include "Thybag\Service\QueryObjectService.php";
use Thybag\SharePointAPI;
$sp = new SharePointAPI('<user@domain.onmicrosoft.com>','<password>','<path_to_WSDL>,'SPONLINE'); //SPONLINE if your point is online else add true instead
$data = $sp->read('Documents');

This will return you the array of all lists stored on sharepoint. Then based on your need you can get the file name by calling array from the above array list. Many more functinalities are avilable as example on the same api site.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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