包括没有php.ini文件的google + api php客户端库

问题描述:

I'm going to integrate google+ sign in with my website and I have now come to a point where I have to setup code on the serverside. Google has this page on how to install their php library: https://developers.google.com/api-client-library/php/start/installation. They recomend using php.ini to include thheir library but my web hoster doesn't allow me to edit php.ini.

I'm supposed to use this library to authenticate users, login users, logout user etcetera. As far as I understand.

How should I include all the necesarry dependencies without editing php.ini? Including the files individually with include or require didn't work for me.

Thanks.

我要将google +登录与我的网站集成,我现在已经到了我需要的地步 在服务器端设置代码。 谷歌有关于如何安装他们的php库的页面: https://开发人员 .google.com / API客户端库/ PHP /启动/安装。 他们建议使用php.ini来包含thheir库,但我的web主机不允许我编辑php.ini。 p>

我应该使用这个库来验证用户,登录用户 ,注销用户等。 据我所知。 p>

如何在不编辑php.ini的情况下包含所有necesarry依赖项? 单独包含带有include或require的文件对我来说不起作用。 p>

谢谢。 p> div>

In the footer of the link in your question it states:

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');

You can follow this step instead of modifying php.ini