title: PHP script cannot access 'Vendor' folder for Azure website
body: <p><strong>Background:</strong></p>
  
  <p>I am using Azure App Services to host a php website.   I’m new to Azure and PHP (programming in general for that matter).  As a starting point I have been following a set of PHP tutorials.  The tutorial that I am currently on requires that I use the PHP mail function, however this fails, and from what I’ve read it is because I need to use the SendGrid mail service when working with an Azure hosted website.</p>
  
  <p><strong>Steps Taken:</strong></p>
  
  <p>First I installed SendGrid from the Azure market place.  I then installed Composer to my project directory (‘wwwroot’) followed by installing the dependencies.  I tried using both ‘sendgrid/smtpapi’ and ‘sendgrid/sendgrid-php’ as dependencies in the ‘composer.json’ file.  The installations appeared successful and the “Vendor” folder (in “wwwroot”) updated with files for “Composer” and “SendGrid”.</p>
  
  <p>I tried a number of code examples for SendGrid but decided to stick with the one below (it seems simpler)</p>
  
  <pre><code>// using SendGrid's PHP Library
  // https://github.com/sendgrid/sendgrid-php
  
  require 'vendor/autoload.php';
  
  $sendgrid = new SendGrid("SENDGRID_APIKEY");
  
  $email    = new SendGrid\Email();
  
  $email-&gt;addTo("test@sendgrid.com")
        -&gt;setFrom("you@youremail.com")
        -&gt;setSubject("Sending with SendGrid is Fun")
        -&gt;setHtml("and easy to do anywhere, even with PHP");
  
  $sendgrid-&gt;send($email);
  </code></pre>
  
  <p>**Problem:**Error’.  When I look at the detailed error logs I get a further error ‘HTTP Error 404.0 - Not Found’.  </p>
  
  <p>I know that the file ‘vendor/autload.php’ required by the mail script does exist </p>
  
  <p>When I run the website the mail script breaks with a ‘500.0 - Internal Server as I can see it from the FTP portal.</p>
  
  <p>However, if I try to browse to the ‘Vendor’ folder via the ‘Kudu’ site, a “Session Expired” error occurs (strangely it only happens for this specific folder).  Internet Explorer developer tools show a further error of “403 Forbidden - Access Denied’</p>
  
  <p><strong>Conclusion:</strong></p>
  
  <p>It is my conclusion that the mail script breaks because it cannot access the files required from the ‘Vendor’ folder.  I however do not know why or how to work around this.  Any recommendations will be greatly appreciated.</p>