Search code examples
curlwindows-server-2008-r2exchangewebservicesubuntu-11.10php-ews

PHP-EWS stuck with curl 7.21.6


I am starting to lose my head around one problem with the PHP EWS.

Now, I have a customer's server which is Ubuntu 11.10 and CURL 7.21.6 (I can't do anything for that) and my development server which is Windows Server 2008 R2 and CURL 7.30.0.

In both servers I have configured two Exchange accounts with the PHP-EWS library.

One is a Exchange 2010 server.

The other one is Exchange Online.

The Exchange Online account works perfectly in both servers.

The Exchange 2010 account works on my Windows server, and it doesn't work on the remote Ubuntu server.

Since I have no access for Debugging (all I have is a Web page for testing) I can only go for hypothesis.

Could the old CURL version on the older server be a problem? Or the OS itself is?


Solution

  • I've wrestled authentication issues with this before, and it did turn out to be the outdated cURL library on my Ubuntu servers. It would work fine on my Windows box running XAMPP, but fail simple authentication once put on a production server.

    You will need to update cURL to atleast v7.23 - it is actually a requirement listed in the php-ews readme. It appears this version adds the NTLM authentication protocol, or fixes it. No way around that unless you can do without authentication I'm afraid.

    Updating cURL is very simple, and shouldn't require a restart of the server. You should be able to update it with the following commands.

    sudo apt-get update
    sudo apt-get install php5-curl
    sudo /etc/init.d/apache2 restart
    

    A restart of the webserver (Apache2 assumed above) is required, but just takes a second. After running these commands myself, my script started working instantly on my production servers.