title: How to set timeout for google api php client library
body: <p>I am using Google's <a href="https://github.com/google/google-api-php-client" rel="nofollow">php client library</a> to build an app. Sometimes, Google takes up to 100 seconds to respond to an API request. I'd like to limit the socket timeout to 30 seconds.</p>
  
  <p>Anyone know how this is possible? Not seeing any clear examples in the docs and I nothing timeout-related jumped out at me looking at the source.</p>
  
  <p>I did find <a href="https://developers.google.com/api-client-library/java/google-api-java-client/errors" rel="nofollow">this example</a> in the docs for the Java client, but I can't seem to find the PHP equivalent.</p>
  
  <p>Thanks for any help.</p>