Including Google Api Client library classes through set_include_path dynamically
<p>I want to include the classes of "google-api-php-client" (and I manually uploaded to my hosting in a subfolder Blog) to use on my website, I'm trying to include it dynamically with "set_include_path" function. However when applying the require_once my code stops there so I failed to include them. I show the code I've been testing for this purpose:</p>

<p>Alternatively, you can Set the same ini directive dynamically in your code.
set_include_path (get_include_path () path_separator '/ path / to / google-api-php-client / src'..);
    </p>

<p>MY CODE:</p>

<pre><code>// 1st try with the full path to the folder classes Google Api:
set_include_path (get_include_path (). path_separator. '/home/u140888/domains/segurosq.com/public_html/blog/google-api-php-client/src'))

// 2nd try with the route from the subfolder Blog to Google Api classes:
set_include_path (get_include_path () path_separator '/ blog / google-api-php-client / src'..);

// 3rd attempt the route from the folder with Google Api classes:
set_include_path (get_include_path () path_separator '/ google-api-php-client / src'..);

// This line require_once my code stops and you can not instantiate the class within Client.php because it has not been added successfully:
require_once 'Google / Client.php';
</code></pre>

<p>I tried this even directly in the include_path parameter settings PHP.ini into my cPanel hosting or hosting provider without success.</p>