CSV Import error: Invalid PHP Path -- but web host says it's valid!

Similar to http://omeka.org/forums/topic/csv-20-import-error, but with a twist.

Getting an "Omeka has encountered an error" message when running CSV Import 2.0, after mapping CSV columns to Dublin categories in Omeka 2.0.2.

My web host's config-n:
PHP 5.3.13 (cgi-fcgi)
OS Linux 3.0.9-bl3-grsec i686
MySQL Server 5.0.91
MySQL Client 5.0.51a

I prepared a custom CSV file, but also tried with test.csv that comes with the plugin, with same result.

I've activated error reporting as suggested in htaccess and config.ini. The Omeka interface still gives only the same general "Omeka has encountered an error" message, so the only detailed message is in errors.log, below.

The problem is, 2 service reps and 1 senior tech at the host confirm that the PHP path is indeed correct (they have provided it in the first place and double-triple checked it -- so I pasted it into config.ini as "background.php.path = "/usr/local/bin/php5–cli"). The error still suggests the problem is with the PHP path, though. No idea where to go from here?!

I have a CSV file waiting, with over 500 items I would like to load.

I have tried changing the
jobs.dispatcher.longRunning = "Omeka_Job_Dispatcher_Adapter_BackgroundProcess" to "Adapter_Synchronous" as suggested in earlier post (http://omeka.org/forums/topic/csv-import-import-stays-queued#post-28262). This processes about 10 rows from my custom CSV file (I use stable URLs to pull .jpg image files into items), but it takes about a minute and it invariably shows 'completed' after only 10 items or so...so not really a solution..

--------------------

2013-04-09T13:01:46-04:00 ERR (3): exception 'RuntimeException' with message 'The configured PHP path (/usr/local/bin/php5–cli) is invalid.' in /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Omeka/Job/Process/Dispatcher.php:115
Stack trace:
#0 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Omeka/Job/Process/Dispatcher.php(94): Omeka_Job_Process_Dispatcher::_checkCliPath('/usr/local/bin/...')
#1 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Omeka/Job/Process/Dispatcher.php(28): Omeka_Job_Process_Dispatcher::getPHPCliPath()
#2 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Omeka/Job/Dispatcher/Adapter/BackgroundProcess.php(31): Omeka_Job_Process_Dispatcher::startProcess('Omeka_Job_Proce...', Object(User), Array)
#3 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Omeka/Job/Dispatcher/Default.php(150): Omeka_Job_Dispatcher_Adapter_BackgroundProcess->send('{"className":"C...', Array)
#4 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/plugins/CsvImport/controllers/IndexController.php(388): Omeka_Job_Dispatcher_Default->sendLongRunning('CsvImport_Impor...', Array)
#5 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/plugins/CsvImport/controllers/IndexController.php(128): CsvImport_IndexController->_dispatchImportTask(Object(CsvImport_Import), 'start')
#6 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Zend/Controller/Action.php(516): CsvImport_IndexController->mapColumnsAction()
#7 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('mapColumnsActio...')
#8 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#9 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#10 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#11 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#12 /hermes/bosweb25b/b1246/nf.ourmove/public_html/csite/omeka/admin/index.php(28): Omeka_Application->run()
#13 {main}

----------------------

Thanks for any help...if there is some other setting I can change, or can provide info, just let me know. I can also setup another admin acct to use to test, if that would help (just email).

Can you see if your web host has PHP's open_basedir restriction enabled?

Omeka reporting an "invalid" path when it's the right one often happens because the host has configured PHP to be unable to access that path.

Just checked my php.ini file for my PHP 5.3 on host account, here is the line it has:

; open_basedir, if set, limits all file operations to the defined directory
; and below.  This directive makes most sense if used in a per-directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
; http://php.net/open-basedir
;open_basedir =

So there is no value after "=", I am guessing this means no restrictions? Just for reference, I've offloaded the full php.ini, you can find it at http://archive.ourmove.org/plugins/CsvImport/csv_files/myPHP5-3ini.txt

Omeka takes the PHP path you give it and essentially just runs $yourPath -v. That just tells the CLI to spit back its version and exit.

When we say the path is "invalid" that means that we basically got back an error when we tried to run that command. This usually means that the path is just wrong.

It seems that Netfirms is your host? There's nothing publicly accessible that says much about PHP CLI support, and several (admittedly old) references that they simply don't offer CLI support for PHP.

The Synchronous adapter stuff sounds like its running up against this: "All PHP/CGI/Perl scripts are limited to a 60 seconds run time. If your script does not complete during that time, it will be killed." Even if you do get the CLI path set up correctly, if this restriction applies to CLI processes, you'll have problems.

You may be able to set the max execution time in your php.ini, but it sounds like 60 seconds might be a hard limit.

John, Thanks again for looking into this. I am taking this back to the host to see if they can provide confirmation that CLI is offered (I also found the forum post which you probably refer to, indicating they don't "offer" CLI)...which is quite ironic considering their Senior tech staff have confirmed that the path is correct, etc.... ;) Back to the trenches..

For those who are running Omeka on a shared hosting acct with Netfirms: their tech support has confirmed that "PHP-CLI is not enabled/supported on our server." This means you are not going to be able to run CSV Import programs using CLI.

Instead, the only option seems to be to use the "Adapter_Synchronous" setting for jobs.dispatcher.longRunning in config.ini (see above), which will most likely timeout after 60 seconds or so.

So it will only be able to process however many records it can in that time (from my testing, that's about 10 rows on the import CSV file...but individual results may vary). Seems like that's that! The only other batch-import alternative is the Dropbox, which works just fine (but of course, that comes with its own shortcomings, namely having to punch in all the metadata by hand..) Good day!

Good info.

Many thanks for your perseverance, and especially for sharing what you learned. I hope it will help many people.

Patrick