I’m having difficulty getting the plugin to import data. The problem appears to be related to the location of my csv file, but my attempts to debug my situation have me confused.
The EE installation is hosted on EngineHosting. I’m using the latest version of CSVGrab.
My csv file is at: http://orel.pmhclients.com/import/testWorks.csv
I initially had the csv file at the root level of the site and then moved it into a directory I created called “import”, the results are the same in both cases.
My CSVGrab template is:
{exp:csvgrab url="http://orel.pmhclients.com/import/testWorks.csv"
delimiter=","
encloser="QUOTE"
weblog="12"
title="1"
skip="2"
use="2|3"
fields="testOpus|testFullTitle"
}
If I use an absolute URL: http://orel.pmhclients.com/import/testWorks.csv nothing is imported, but I get no errors.
If I use an absolute URL, but do not have the line: encloser=“QUOTE” in the go.php template, I get this error:
Warning: fgetcsv() [function.fgetcsv]: enclosure must be a character in /www/userid/public_html/systemDirectory/plugins/pi.csvgrab.php on line 202
I don’t know if that’s any indication of whether it is finding the csv file or not.
But if I use a relative URL: url=”/import/testWorks.csv”
I get a long sheet of errors, headed by these two lines:
Warning: fopen() [function.fopen]: open_basedir restriction in effect. File(/import/testWorks.csv) is not within the allowed path(s): (/www/userid) in /www/userid/public_html/systemDirectory/plugins/pi.csvgrab.php on line 192
Warning: fopen(/import/testWorks.csv) [function.fopen]: failed to open stream: Operation not permitted in /www/userid/public_html/systemDirectory/plugins/pi.csvgrab.php on line 192
and after that repeating:
Warning: fgetcsv() expects parameter 1 to be resource, boolean given in /www/userid/public_html/systemDirectory/plugins/pi.csvgrab.php on line 202
Warning: array_unshift() [function.array-unshift]: The first argument should be an array in /www/userid/public_html/systemDirectory/plugins/pi.csvgrab.php on line 211
Checking:
This will continue to repeat and add to the page of errors until I stop the page from loading.
I assume this just means it can’t load the csv file, but I don’t understand why. Is it a permissions issue? Has anyone else had trouble using the plug-in on an EngineHosting site?
Each time I load the relative URL version of go.php again, it adds a blank entry to the weblog. The version with the absolute URL doesn’t do this.
Addendum: On the advice of the reply below, I’ve changed the system directory name to “sysetemDirectory” and the user ID to “userid” in the quoted code and errors above.