Config file not found as specified - Home directory could not be located so it was not searched

2018-02-26 Thread Marty G
Hi Guys, 

I've been using Adwords API for around a year or so, on a mini project 
using xampp & with each new release, I've managed to get it working using 
the old auth.ini file.

So I've downloaded the latest Google Adwords API using composer & installed 
it to our classes directory

   - */site-root/main-application/classes/google-adwords/ *
   
I've setup all our details within the new config file "*adsapi_php.ini*" 
which all looks good!
but... for the life of me, I just cant figure out where the "
*adsapi_php.ini*" file should be located, 
so far I've tried:

   - /site-root/
   - /site-root/main-application/
   - /site-root/main-application/classes/
   - /site-root/main-application/classes/google-adwords/
   - /site-root/main-application/classes/google-adwords/vendor/
   - /site-root/main-application/classes/google-adwords/vendor/googleads/

Each time I try a new location I still get the same fatal error:

Uncaught exception 'InvalidArgumentException' with message 'Config file not 
found as specified: 'adsapi_php.ini'. 
Home directory could not be located so it was not searched.' in C:\xampp\
htdocs\main-application\classes\google-adwords\vendor\googleads\googleads-
php-lib\src\Google\AdsApi\Common\ConfigurationLoader.php on line 77

*Note: *running the *$_SERVER* global to find the home path, 
I would assume it's the [*DOCUMENT_ROOT*] => C:/xampp/htdocs
 
Array ( [MIBDIRS] => C:/xampp/php/extras/mibs [MYSQL_HOME] => 
\xampp\mysql\bin [OPENSSL_CONF] => C:/xampp/apache/bin/openssl.cnf 
[PHP_PEAR_SYSCONF_DIR] => \xampp\php [PHPRC] => \xampp\php [TMP] => 
\xampp\tmp [HTTP_HOST] => 86.29.37.141 [HTTP_CONNECTION] => keep-alive 
[HTTP_CACHE_CONTROL] => max-age=0 [HTTP_USER_AGENT] => Mozilla/5.0 (Windows 
NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) 
Chrome/63.0.3239.132 Safari/537.36 [HTTP_UPGRADE_INSECURE_REQUESTS] => 1 
[HTTP_ACCEPT] => 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
 
[HTTP_ACCEPT_ENCODING] => gzip, deflate [HTTP_ACCEPT_LANGUAGE] => 
en-GB,en-US;q=0.9,en;q=0.8,fr;q=0.7 [HTTP_COOKIE] => 
PHPSESSID=5lfeujbh3ffdvn6d2c93vtjdg2 [PATH] => 
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\AMD 
APP\bin\x86_64;C:\Program Files (x86)\AMD 
APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 
Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files 
(x86)\Skype\Phone\; [SystemRoot] => C:\Windows [COMSPEC] => 
C:\Windows\system32\cmd.exe [PATHEXT] => 
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC [WINDIR] => 
C:\Windows [SERVER_SIGNATURE] => Apache/2.4.12 (Win32) OpenSSL/1.0.1l 
Server at 86.29.37.141 Port 80 [SERVER_SOFTWARE] => Apache/2.4.12 (Win32) 
OpenSSL/1.0.1l [SERVER_NAME] => 86.29.37.141 [SERVER_ADDR] => 192.168.0.18 
[SERVER_PORT] => 80 [REMOTE_ADDR] => 86.27.46.116 [*DOCUMENT_ROOT*] => 
C:/xampp/htdocs [REQUEST_SCHEME] => http [CONTEXT_PREFIX] => 
[CONTEXT_DOCUMENT_ROOT] => C:/xampp/htdocs [SERVER_ADMIN] => test @ 
testserver.co.uk [SCRIPT_FILENAME] => 
C:/xampp/htdocs/main-application/test/test-adwords.php 
[REMOTE_PORT] => 62129 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => 
HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => /
main-application/test/test-adwords.php [SCRIPT_NAME] => 
/main-application/test/test-adwords.php 
[PHP_SELF] => /main-application/test/test-adwords.php [REQUEST_TIME_FLOAT] 
=> 1519396759.455 [REQUEST_TIME] => 1519396759 ) 


What am I missing?

Cheers

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/edc73735-c486-4461-a19b-b6fd1b1625ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Location of adsapi_php.ini

2018-02-26 Thread Marty G
HI Guys

I've been using the Adwords API for around a year or so, I always used the 
auth.ini file on each api update we managed to get it working
but recently we upgraded to the latest API, using composer to install to 
our classes folder *C:\xampp\htdocs\main-application\classes\*
to which we have the vendor folder & other folders needed to run the api, 
I've filled out the adsapi_php.ini with our project details, but while 
running our test file we encounter the fatal error & missing ini file.

I printed the $_SERVER output in order to find the home directory & tried 
re-locating the ini file to various locations on the server install, but 
still get the fatal error


Fatal error: Uncaught exception 'InvalidArgumentException' with message 
'Config file not found as specified: 'adsapi_php.ini'.

Home directory could not be located so it was not searched.' in 
C:\xampp\htdocs\main-application\classes\google-adwords\vendor\googleads\googleads-php-lib\src\Google\AdsApi\Common\ConfigurationLoader.php
 
on line 77


Array
(
[MIBDIRS] => C:/xampp/php/extras/mibs
[MYSQL_HOME] => \xampp\mysql\bin
[OPENSSL_CONF] => C:/xampp/apache/bin/openssl.cnf
[PHP_PEAR_SYSCONF_DIR] => \xampp\php
[PHPRC] => \xampp\php
[TMP] => \xampp\tmp
[HTTP_HOST] => localhost
[HTTP_CONNECTION] => keep-alive
[HTTP_UPGRADE_INSECURE_REQUESTS] => 1
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 
(KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36
[HTTP_ACCEPT] => 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
[HTTP_ACCEPT_ENCODING] => gzip, deflate, br
[HTTP_ACCEPT_LANGUAGE] => en-GB,en-US;q=0.9,en;q=0.8
[PATH] => C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\AMD 
APP\bin\x86_64;C:\Program Files (x86)\AMD 
APP\bin\x86;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
 
Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files 
(x86)\Skype\Phone\;
[SystemRoot] => C:\Windows
[COMSPEC] => C:\Windows\system32\cmd.exe
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
[WINDIR] => C:\Windows
[SERVER_SIGNATURE] => Apache/2.4.12 (Win32) OpenSSL/1.0.1l Server at 
localhost Port 80
[SERVER_SOFTWARE] => Apache/2.4.12 (Win32) OpenSSL/1.0.1l
[SERVER_NAME] => localhost
[SERVER_ADDR] => ::1
[SERVER_PORT] => 80
[REMOTE_ADDR] => ::1
[DOCUMENT_ROOT] => C:/xampp/htdocs
[REQUEST_SCHEME] => http
[CONTEXT_PREFIX] => 
[CONTEXT_DOCUMENT_ROOT] => C:/xampp/htdocs
[SERVER_ADMIN] => testsupport @ test.co.uk
[SCRIPT_FILENAME] => C:/xampp/htdocs/main-application/test/test-adwords.php 
[REMOTE_PORT] => 61099 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => 
HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => /
[REMOTE_PORT] => 61099
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => 
[REQUEST_URI] => /
[REMOTE_PORT] => 61099
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => 
[REQUEST_URI] => /main-application/test/test-adwords.php
[SCRIPT_NAME] => /main-application/test/test-adwords.php
[PHP_SELF] => /main-application/test/test-adwords.php 
[REQUEST_TIME_FLOAT] => 1519638340.619
[REQUEST_TIME] => 1519638340
) 


I've tried locating our ini file to:

   - C:\xampp\htdocs\
   - C:\xampp\htdocs\main-application\
   - C:\xampp\htdocs\main-application\classes\
   - C:\xampp\htdocs\main-application\classes\google-adwords
   - C:\xampp\htdocs\main-application\classes\google-adwords\vendor\

Still getting the same error..!


Cheers

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/89ff3f41-d112-4054-8e6e-4c286ca73cf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Location of adsapi_php.ini

2018-02-28 Thread Marty G
Hi Dhanya

many thanks for the reply...

I've ran the example code but this throws the error

*Could not locate home directory.*


I'm currently running the the api via a windows xampp install (where I've 
been running it previously for over a year)

so unsure as what to try next?

thanks

Marty


On Monday, 26 February 2018 18:10:25 UTC, Dhanya Sundararaju (AdWords API 
Team) wrote:
>
> Hi Marty,
>
> You would need to copy down the adsapi_php.ini to your home directory 
> .
>  
> To find your home directory, please run this sample code 
> 
>  and 
> let me know if you have further questions.
>
> Regards,
> Dhanya, AdWords API Team
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bfcacb71-2094-44ea-9912-350f42982f77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Location of adsapi_php.ini

2018-02-28 Thread Marty G
I just wanted to add that I've tried the EnviromentTest on my remote Apache 
shared server & this also throws the exception 

*could not located home directory*


I know running the class file, is looking for variations of the home 
directory

   - getenv('HOME')
   - getenv('HOMEDRIVE')
   - getenv('HOMEPATH')

print_r($_SERVER)

Array
(
[CONTEXT_DOCUMENT_ROOT] => /home/testsite/public_html
[CONTEXT_PREFIX] => 
[DOCUMENT_ROOT] => /home/testsite/public_html
[GATEWAY_INTERFACE] => CGI/1.1
[HTTP_ACCEPT] => 
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
[HTTP_ACCEPT_ENCODING] => gzip, deflate
[HTTP_ACCEPT_LANGUAGE] => en-GB,en-US;q=0.9,en;q=0.8,fr;q=0.7
[HTTP_CACHE_CONTROL] => max-age=0
[HTTP_CONNECTION] => keep-alive
[HTTP_COOKIE] => _jsuid=4094727426; _ga=GA1.3.1583573795.1519032551; 
wp-settings-1=editor%3Dhtml%26libraryContent%3Dbrowse%26crawl_category_tab%3Dpop%26posts_list_mode%3Dlist%26mfold%3Do;
 wp-settings-time-1=1519129313
[HTTP_HOST] => testsite.co.uk
[HTTP_UPGRADE_INSECURE_REQUESTS] => 1
[HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; Win64; x64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36
[PATH] => /bin:/usr/bin
[QUERY_STRING] => 
[REDIRECT_STATUS] => 200
[REMOTE_ADDR] => 86.27.46.116
[REMOTE_PORT] => 60200
[REQUEST_METHOD] => GET
[REQUEST_SCHEME] => http
[REQUEST_URI] => /home-test.php
[SCRIPT_FILENAME] => /home/test/public_html/home-test.php
[SCRIPT_NAME] => /home-test.php
[SERVER_ADDR] => 72.249.48.7
[SERVER_ADMIN] => webmaster @ testsite.co.uk
[SERVER_NAME] => testsite.co.uk
[SERVER_PORT] => 80
[SERVER_PROTOCOL] => HTTP/1.1
[SERVER_SIGNATURE] => 
[SERVER_SOFTWARE] => Apache
[TZ] => America/Chicago
[UNIQUE_ID] => WpbTVqgD0l1Wrj5KH1CUrws
[PHP_SELF] => /home-test.php
[REQUEST_TIME_FLOAT] => 1519833943.0969
[REQUEST_TIME] => 1519833943 

) 

I've added a few lines to the Eviro class 

}else if (!empty($_SERVER['DOCUMENT_ROOT']) ) {
  $home = $_SERVER['DOCUMENT_ROOT'];
}

this passes the test, because we know the DOCUMENT_ROOT is found in $_SERVER

would it not be better adding this to the API ?

Cheers

Marty

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a94bd7e7-14e6-4b2b-9bf7-eb54440485a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.