I’ve been trying to get the latest ImageMagic working so I can convert AVIF on my server. I finally found the fix to get this AVIF Local Support working.
Here’s the short post-mortem.
What was wrong
-
Symptom: WordPress plugin reported
/usr/local/bin/magickwas not executable, even though the binary existed, was 0755, and worked on the CLI. -
Root cause: The site’s vhost-level
open_basedir(in OpenLiteSpeed, managed via CyberPanel) restricted PHP file access to:/tmp:/home/daviddegner.com/Because
/usr/local/binwasn’t inopen_basedir,is_executable('/usr/local/bin/magick')returnedno. Many plugins checkis_executable()and bail out, so CLI ImageMagick calls were blocked from PHP—even thoughmagick -versioncould sometimes still execute.
How we found it
-
Confirmed LSPHP’s real
php.iniand globals:/usr/local/lsws/lsphp83/bin/php -i | egrep 'Loaded Configuration|open_basedir|disable_functions'→ Global
open_basedirwas OK, so the problem wasn’t the system-wide ini. -
Created a tiny PHP page (web context) showing:
php_sapi_name()→litespeedini_get('open_basedir')→/tmp:/home/daviddegner.com/← too narrowis_executable('/usr/local/bin/magick')→no
That proved a vhost override was in effect.
The fix
Update the vhost’s PHP admin value for open_basedir to include the ImageMagick paths.
In CyberPanel → Websites → [site] → vHost Conf, set:
phpIniOverride {
php_admin_value open_basedir "/tmp:$VH_ROOT:/usr/local/bin:/usr/local/lib"
}
Important syntax: no
=afterphp_admin_value.
$VH_ROOTexpands to your site root (safer than hard-coding the full path).
Then restart LiteSpeed.
How to verify
-
Reload your test page:
open_basedirnow shows/tmp:...:/usr/local/bin:/usr/local/libis_executable('/usr/local/bin/magick')→ yes
-
Re-run the plugin’s diagnostics.
Why this happens a lot
- CyberPanel/OLS often sets a tight
open_basedirper site for security. - Editing the global php.ini (or CyberPanel global PHP configs) doesn’t help if the vhost still overrides it.
- Plugins commonly require
is_executable()to pass before using a CLI tool.
Quick checklist for others
- Permissions:
chmod 755 /usr/local/bin/magick(andconvertsymlink). - Libraries:
ldd /usr/local/bin/magick→ no “not found”. - Which php.ini? Use LSPHP to check (
lsphp83/bin/php -i). - Web context test: a PHP page printing SAPI,
open_basedir,disable_functions,is_executable(). - If blocked: widen vhost
open_basedirto include/usr/local/binand/usr/local/lib(and site paths). - Restart LiteSpeed and retest.
Optional workaround
If you can’t change open_basedir, create a wrapper inside the allowed path and point the plugin to it:
/home/your-site/bin/magick -> exec /usr/local/bin/magick "$@"
(Then ensure /home/your-site/bin is within open_basedir.)
That’s it—vhost-level open_basedir was the blocker; widening it fixed the plugin’s executability check.