Valid PHP CLI Path Unable to Execute Command

Hi everyone,

I have installed Omeka S 4.0 on an OVH server.
I couldn’t do any batch action because I didn’t have the PHP CLI path but I finally found it in some remote OVH doc : /usr/local/php8.1/bin/php
Beforehand, I tried several other paths which Omeka always flagged as invalid.
This one seems to work as it is not flagged, and batch actions on items for example finally work.

However, in System Information, when clicking the “Get PHP CLI Version” I just get
[Unable to execute command]
And when trying “Index full-text search” from the Global Settings, the job is still an error.

2023-02-08T12:42:53+00:00 ERR (3):  {"userId":1,"jobId":13}
2023-02-08T12:42:54+00:00 ERR (3): Command "/usr/local/php8.1/bin/php '/home/alyxtjfreq/www/application/data/scripts/perform-job.php' --job-id '13' --base-path '' --server-url '' > /dev/null 2>&1 &" failed with status code -1. {"userId":1,"jobId":13}
2023-02-08T12:42:54+00:00 ERR (3): Omeka\Job\Exception\RuntimeException: PHP-CLI error: job script failed to execute. in /home/alyxtjfreq/www/application/src/Job/DispatchStrategy/PhpCli.php:85
Stack trace:
#0 /home/alyxtjfreq/www/modules/Log/src/Job/Dispatcher.php(32): Omeka\Job\DispatchStrategy\PhpCli->send(Object(Omeka\Entity\Job))
#1 /home/alyxtjfreq/www/application/src/Job/Dispatcher.php(91): Log\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Omeka\Job\DispatchStrategy\PhpCli))
#2 /home/alyxtjfreq/www/application/src/Controller/Admin/SettingController.php(20): Omeka\Job\Dispatcher->dispatch('Omeka\\Job\\Index...')
#3 /home/alyxtjfreq/www/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(71): Omeka\Controller\Admin\SettingController->browseAction()
#4 /home/alyxtjfreq/www/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent))
#5 /home/alyxtjfreq/www/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#6 /home/alyxtjfreq/www/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(97): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#7 /home/alyxtjfreq/www/vendor/laminas/laminas-mvc/src/DispatchListener.php(132): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response))
#8 /home/alyxtjfreq/www/vendor/laminas/laminas-eventmanager/src/EventManager.php(319): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent))
#9 /home/alyxtjfreq/www/vendor/laminas/laminas-eventmanager/src/EventManager.php(179): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure))
#10 /home/alyxtjfreq/www/vendor/laminas/laminas-mvc/src/Application.php(325): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent))
#11 /home/alyxtjfreq/www/index.php(21): Laminas\Mvc\Application->run()
#12 {main} {"userId":1,"jobId":13}
2023-02-08T12:42:55+00:00 ERR (3): Omeka\Api\Exception\OperationNotImplementedException: The Omeka\Api\Adapter\ValueAnnotationAdapter adapter does not implement the search operation. in /home/alyxtjfreq/www/application/src/Api/Adapter/AbstractAdapter.php:38
Stack trace:
#0 /home/alyxtjfreq/www/application/src/Api/Adapter/ValueAnnotationAdapter.php(27): Omeka\Api\Adapter\AbstractAdapter->search(Object(Omeka\Api\Request))
#1 /home/alyxtjfreq/www/application/src/Api/Manager.php(221): Omeka\Api\Adapter\ValueAnnotationAdapter->search(Object(Omeka\Api\Request))
#2 /home/alyxtjfreq/www/application/src/Api/Manager.php(59): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#3 /home/alyxtjfreq/www/application/src/Job/IndexFulltextSearch.php(29): Omeka\Api\Manager->search('value_annotatio...', Array, Array)
#4 /home/alyxtjfreq/www/application/src/Job/DispatchStrategy/Synchronous.php(34): Omeka\Job\IndexFulltextSearch->perform()
#5 /home/alyxtjfreq/www/modules/Log/src/Job/Dispatcher.php(32): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#6 /home/alyxtjfreq/www/application/data/scripts/perform-job.php(66): Log\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Log\Job\DispatchStrategy\Synchronous))
#7 {main} {"userId":1,"jobId":13}
2023-02-08T12:42:55+00:00 WARN (4): Warning: getopt(): Passing null to parameter #1 ($short_options) of type string is deprecated
in /home/alyxtjfreq/www/application/data/scripts/perform-job.php on line 14 {"userId":1,"jobId":13}

Please note that I haven’t found a valid ImageMagick Directory for my shared hosting on OVH. Supposedly Imagick should function but it doesn’t.
I have seen discussions around Omeka Classic but not S.
So I get an error when trying to upload images and when trying background jobs…

I’m not sure quite what’s happening there… a couple of those messages are small bugs we’ll have fixed in an update to 4.0 but they wouldn’t really affect things to this level. What’s interesting here is that the command that started the job reported failure: it returned -1, but the job ran anyway.

I wonder if that’s actually the path to a PHP binary that’s not the CLI (maybe instead it’s a CGI binary, intended for running with a web server). That could account for a failure when we try to run the command to confirm the path points to PHP’s CLI and report its version.

ImageMagick should be a different issue. I’m not sure of what the path should be, but it does look like OVH supports the Imagick extension from their docs, though it looks like you’d have to specifically enable it. If you have that extension enabled (it should be listed in System Information if so), then you could switch to the Imagick thumbnailer by changing the setting for Omeka\File\Thumbnailer in your config/local.config.php file. Imagick doesn’t need you to give a path and it doesn’t run an external command, so might avoid any problems you’re having there.

Thank @jflatnes I had not checked properly if Imagick worked, as the Image Magick kept sending an error in System Info. So that’s settled.

My issue looks similar to this one CSV Import 'PHP-CLI error: job script failed to execute - #3 by TestingItOut
But exec and proc_open are not marked as disabled. Here is my full System Info :

Omeka S
Version 	4.0.0
Version 	8.1.6
SAPI 	fpm-fcgi
Memory Limit 	512M
POST Size Limit 	130M
File Upload Limit 	128M
Garbage Collection 	Yes
Extensions 	bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, exif, FFI, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, json, libxml, mbstring, memcached, mongodb, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, redis, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zip, zlib
Disabled Functions 	dl, _dyuweyrj4, _dyuweyrj4r
Server Version 	5.7.41-log
Client Version 	mysqlnd 8.1.6
Version 	Linux 5.15.74-ovh-vps-grsec-zfs-classid x86_64
active 	Block Plus (, Clean Url (, Easy Admin (, Extract Text (1.3.0), Generic module (3.4.39), Log (3.4.13), Numeric Data Types (1.10.0)
PHP CLI path 	/usr/local/php8.1/bin/php
ImageMagick directory 	[invalid]

This topic was automatically closed 360 days after the last reply. New replies are no longer allowed.