Search code examples
phpexchangewebservices

getting php-ews to work


Downloaded php-ews from https://github.com/Garethp/php-ews and did a

            require_once ($server_path."/scripts/ews/API.php");

which seems to work (log gives no error).

But doing this:

            $ews = ExchangeWebServices::fromUsernameAndPassword($exchange_host, $_SESSION["user_data"]["u_email"], $_SESSION["user_data"]["u_pwd"], $options = array());

gives a

PHP Fatal error:  Class 'ExchangeWebServices' not found 

Any one have an idea?


Solution

  • Well, I'd like to suggest you try installing my library with Composer. You can download it here. Then, once installed, you can install my library using it. Just create a composer.json file with the following

    {
        "require": {
            "garethp/php-ews": "0.8.*"
        }
    }
    

    Then run a composer install in the directory. This should create a vendor/ folder with a vendor/autoload.php file. Include this file, and the rest of the classes should be autoloaded