Problem indexing records, maybe path related

I'm using Omeka 2.1.2 with the hosting company Vidahost and I'm getting an error message while attempting to index records from Settings > Search.

Omeka has encountered an error
RuntimeException
The configured PHP Path () is invalid

#0 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Process/Dispatcher.php(94): Omeka_Job_Process_Dispatcher::_checkCliPath('')
#1 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Process/Dispatcher.php(28): Omeka_Job_Process_Dispatcher::getPHPCliPath()
#2 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Dispatcher/Adapter/BackgroundProcess.php(31): Omeka_Job_Process_Dispatcher::startProcess('Omeka_Job_Proce...', Object(User), Array)
#3 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Dispatcher/Default.php(150): Omeka_Job_Dispatcher_Adapter_BackgroundProcess->send('{"className":"J...', Array)
#4 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/controllers/SettingsController.php(101): Omeka_Job_Dispatcher_Default->sendLongRunning('Job_SearchTextI...')
#5 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Controller/Action.php(516): SettingsController->editSearchAction()
#6 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('editSearchActio...')
#7 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#8 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#9 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#10 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#11 /var/sites/d/dougmccrae.co.uk/public_html/idldev/admin/index.php(28): Omeka_Application->run()
#12 {main}

This could be related to a problem I've also been having with the PDF Text plugin. Vidahost say that Poppler's utility pdftotext is available but PDF Text can't locate it. When I comment out the code in PDF Text that checks for the existence of pdftotext, and try to index the files from within PDF Text, I get the following error messages.

Omeka has encountered an error
RuntimeException
The configured PHP Path () is invalid

#0 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Process/Dispatcher.php(94): Omeka_Job_Process_Dispatcher::_checkCliPath('')
#1 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Process/Dispatcher.php(28): Omeka_Job_Process_Dispatcher::getPHPCliPath()
#2 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Dispatcher/Adapter/BackgroundProcess.php(31): Omeka_Job_Process_Dispatcher::startProcess('Omeka_Job_Proce...', Object(User), Array)
#3 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Job/Dispatcher/Default.php(150): Omeka_Job_Dispatcher_Adapter_BackgroundProcess->send('{"className":"P...', Array)
#4 /var/sites/d/dougmccrae.co.uk/public_html/idldev/plugins/PdfText/PdfTextPlugin.php(96): Omeka_Job_Dispatcher_Default->sendLongRunning('PdfTextProcess')
#5 [internal function]: PdfTextPlugin->hookConfig(Array)
#6 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Plugin/Broker.php(145): call_user_func(Array, Array)
#7 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/controllers/PluginsController.php(50): Omeka_Plugin_Broker->callHook('config', Array, Object(Plugin))
#8 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Controller/Action.php(516): PluginsController->configAction()
#9 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('configAction')
#10 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#11 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#12 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#13 /var/sites/d/dougmccrae.co.uk/public_html/idldev/application/libraries/Omeka/Application.php(79): Zend_Application->run()
#14 /var/sites/d/dougmccrae.co.uk/public_html/idldev/admin/index.php(28): Omeka_Application->run()
#15 {main}

This is usually an problem where the PHP for background processes is located someplace where Omeka can't find it. The host should be able to tell you what the correct path to background (command line) PHP is. Then, you can put it in the application/config/config.ini file by finding this line and filling it in.

background.php.path = ""

This solution worked for the indexing records problem, the path was "/usr/local/bin/php".

However there is still a problem with pdftotext. Vidahost tell me that it's located at "/usr/bin/pdftotext". Is there another variable I can set to allow PDF Text to find it?

Part of the issue maybe because of Vidahost's cloud hosting, so the relevant files or processes required are not located on one machine.

The problem has now been resolved. It was caused by the Unix environmental variable PATH being set to /bin while the Poppler util pdftotext was in /usr/bin on Vidahost's cloud hosted system.

This was resolved by adding the code "PATH=/usr/bin;" at the start of the two calls to shell_exec within the file PdfTextPlugin.php, at lines 44 and 134.