access denied when using netrc via php-curl on apache
Posted: Tue May 16, 2023 5:36 pm America/New_York
So I'm following your directions on this page:
https://urs.earthdata.nasa.gov/documentation/for_users/data_access/php
And the netrc file I created works fine via command line (ubuntu):
curl -O -b <path to cookies file> -c <path to cookies file> -L -n https://opendap.earthdata.nasa.gov/collections/.....
But it doesn't when using the php-curl script example described in the link above. When I use curl via command line and then use the php-curl script then the latter works, but only because authentication has already been performed.
So I'm wondering where this netrc file should actually reside to get the php-curl script to work. I doubt /home/ubuntu is proper place for it when utilized by php-curl.
https://urs.earthdata.nasa.gov/documentation/for_users/data_access/php
And the netrc file I created works fine via command line (ubuntu):
curl -O -b <path to cookies file> -c <path to cookies file> -L -n https://opendap.earthdata.nasa.gov/collections/.....
But it doesn't when using the php-curl script example described in the link above. When I use curl via command line and then use the php-curl script then the latter works, but only because authentication has already been performed.
So I'm wondering where this netrc file should actually reside to get the php-curl script to work. I doubt /home/ubuntu is proper place for it when utilized by php-curl.