When I was testing the the Google Login Plugin, I noticed the following warnings in my server logs:
PHP Warning: file_exists(): open_basedir restriction in effect.
File(/tmp/Google_Client/62/6201104e2d7bc73dc749e196eb0c344b) is not within the allowed path(s):
(/var/www/html/osclass:/php-temp/my-website/:/usr/share/php/:/usr/share/javascript/) in
/var/www/html/osclass/oc-content/plugins/google_login/src/cache/Google_FileCache.php on line 96,
referer: https://accounts.google.com/
The warning is s result of having the following config in my Apache2 server:
<IfModule mod_php7.c>
php_admin_value upload_tmp_dir /php-temp/my-website/tmp/
php_admin_value open_basedir /var/www/html/osclass/:/php-temp/my-website/:/usr/share/php/:/usr/share/javascript/
</IfModule>
I don't really like the /tmp/ dir, that's why I wanted to change it to /php-temp/my-website/ dir which is unique for any webpage I want to host on my server -- it helps with apparmor policy.
There's the plugins/google_login/src/config.php file, and the following code in it:
// IO Class dependent configuration, you only have to configure the values
// for the class that was configured as the ioClass above
'ioFileCache_directory' =>
(function_exists('sys_get_temp_dir') ?
sys_get_temp_dir() . '/Google_Client' :
'/tmp/Google_Client'),
I tried to change this /Google_Client or /tmp/Google_Client to my /php-temp/my-website/Google_Client , but it always was /tmp/...
So I changed the above code to the following:
'ioFileCache_directory' => '/php-temp/my-website/Google_Client',
This helped, but I think users should be able to customize this TMP dir because in shared hosting, you are unable to change the open_basedir directive.
Also I've read about
disabling cache for Google Login Plugin, which also could be the option to solve the issue.