PHP path Runtime exception with Batch Upload

I received two different errors trying to run BatchUpload on both a new 2.61 instance and on 2.7 hosted on Reclaim. I’ve previously used BatchUpload without a problem on the Reclaim instance, but it’s been several months since I needed to load any images.

Deprecated : The each() function is deprecated. This message will be suppressed on further calls in /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Zend/Cache/Backend.php on line 79


The configured PHP path (/usr/bin/php) is invalid.

RuntimeException: The configured PHP path (/usr/bin/php) is invalid. in /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Omeka/Job/Process/Dispatcher.php:114
Stack trace:
#0 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Omeka/Job/Process/Dispatcher.php(93): Omeka_Job_Process_Dispatcher::_checkCliPath(’/usr/bin/php’)
#1 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Omeka/Job/Process/Dispatcher.php(28): Omeka_Job_Process_Dispatcher::getPHPCliPath()
#2 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Omeka/Job/Dispatcher/Adapter/BackgroundProcess.php(31): Omeka_Job_Process_Dispatcher::startProcess(‘Omeka_Job_Proce…’, Object(User), Array)
#3 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Omeka/Job/Dispatcher/Default.php(151): Omeka_Job_Dispatcher_Adapter_BackgroundProcess->send(’{“className”:"B…’, Array)
#4 /home/icgarchives/public_html/omeka-2.6.1/plugins/BatchUpload/libraries/BatchUpload/Wizard/ExistingCollection.php(151): Omeka_Job_Dispatcher_Default->sendLongRunning(‘BatchUpload_Job…’, Array)
#5 /home/icgarchives/public_html/omeka-2.6.1/plugins/BatchUpload/libraries/BatchUpload/Application/AbstractWizard.php(84): BatchUpload_Wizard_ExistingCollection->step2Process(Array)
#6 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Omeka/Plugin/Broker.php(154): BatchUpload_Application_AbstractWizard->_stepProcess(Array)
#7 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/globals.php(188): Omeka_Plugin_Broker->callHook(‘batch_upload_ex…’, Array)
#8 /home/icgarchives/public_html/omeka-2.6.1/plugins/BatchUpload/controllers/JobsController.php(155): fire_plugin_hook(‘batch_upload_ex…’, Array)
#9 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Zend/Controller/Action.php(516): BatchUpload_JobsController->wizardAction()
#10 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch(‘wizardAction’)
#11 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#12 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(105): Zend_Controller_Front->dispatch()
#13 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Zend/Application.php(384): Zend_Application_Bootstrap_Bootstrap->run()
#14 /home/icgarchives/public_html/omeka-2.6.1/application/libraries/Omeka/Application.php(73): Zend_Application->run()
#15 /home/icgarchives/public_html/omeka-2.6.1/admin/index.php(28): Omeka_Application->run()
#16 {main}

Any insight on this? Is this Zend? PHP? I created an issue on the BatchUpload Github repo.

I tried editing config.ini to usr/local/bin/php but got exactly the same error but that path.

The each notice is specific to you running 2.6.1 and should be fixed in 2.7; it’s unrelated to your problem, I think.

The exception about the path is just saying that the configured path to the PHP CLI in your application/config/config.ini is incorrect. You might want to check with Reclaim that /usr/bin/php is still the correct PHP path you should be using; it’s possible that underlying server changes have moved the PHP binary to a different location and you just need to update that configured path.

Updating 2.6.1 to 2.7 fixed the each error.

For the problem instance - my Reclaim instance is fine - I’ve tried updating the config.ini to both /usr/bin/php and /usr/local/bin/php and it still fails.

The volunteer sys admin on the project (we’re both volunteers) says that it seems like the $cliPath isnt getting set right by Dispatcher.php. This puzzles me since it works fine on my Reclaim instance after I updated the config.ini to /usr/local/bin/php.

Running which php gets this:


But something is maybe weird with PHP on the machine. When he runs “/usr/local/bin/php -v” the first line comes out as:

PHP 7.2.24 (cli) (built: Oct 30 2019 15:00:52) ( NTS )

When he runs “/usr/bin/php -v” the first line comes out as:

PHP 7.2.24 (cgi-fcgi) (built: Oct 30 2019 15:00:56)

There is also a directory entry “/usr/bin/php-cli” which is a sym link to “/usr/local/bin/php”.

Any insight into this?

I’m not aware of any cases where a path set in config.ini doesn’t take effect, so I’d make sure it’s the correct file that’s being edited, meaning both that it’s application/config/config.ini and that it’s the copy that’s in the actual site and not a backup copy or other site or something like that. Also make sure the line is not commented out, no typos, stuff like that.

From your description, either /usr/bin/php-cli or /usr/local/bin/php should be acceptable paths.