Hi, I’ve been getting this fatal error when logging into the admin of individual books (network OK).
Fatal error: Uncaught Error: Call to undefined function Pressbooks\Utility\exec() in /home/wcclibra/public_html/wp-content/plugins/pressbooks/inc/utility/namespace.php:298 Stack trace: #0 /home/wcclibra/public_html/wp-content/plugins/pressbooks/inc/modules/export/epub/class-epub.php(2843): Pressbooks\Utility\check_epubcheck_install() #1 /home/wcclibra/public_html/wp-content/plugins/pressbooks/inc/modules/themeoptions/class-admin.php(73): Pressbooks\Modules\Export\Epub\Epub::hasDependencies() #2 /home/wcclibra/public_html/wp-content/plugins/pressbooks/inc/modules/themeoptions/class-admin.php(110): Pressbooks\Modules\ThemeOptions\Admin->getTabs() #3 /home/wcclibra/public_html/wp-includes/class-wp-hook.php(341): Pressbooks\Modules\ThemeOptions\Admin->loadTabs('') #4 /home/wcclibra/public_html/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array) #5 /home/wcclibra/public_html/wp-includes/plugin.php(522): WP_Hook->do_action(Array) #6 /home/wcclibra/public_html/wp-admin/admin.php(180): do_action('admin_init') #7 /home/wcclibra/public_html/wp-admin/index.php(10): require_once('/home/wcclibra/...') #8 {main} thrown in /home/wcclibra/public_html/wp-content/plugins/pressbooks/inc/utility/namespace.php on line 298
I’ve got some code to create a MU plugin to bypass epub & Prince validation
<?php
/**
* Disable Pressbooks CLI dependency checks on shared hosting
* Prevents fatal errors when exec() is disabled
*/
namespace {
// Short-circuit all Pressbooks dependency checks that rely on exec()
add_filter( 'pb_prince_dependencies_installed', '__return_false', 1 );
add_filter( 'pb_epubcheck_dependencies_installed', '__return_false', 1 );
// Defensive: hide formats that would trigger dependency checks
add_filter( 'pb_export_formats', function ( $formats ) {
// Remove Prince / DocRaptor
unset(
$formats['standard']['docraptor'],
$formats['standard']['docraptor_print'],
$formats['standard']['pdf'],
$formats['standard']['print_pdf']
);
return $formats;
}, 1 );
}
I still cannot get past this fatal error. How do I fix this or jettison those dependency checks altogether (on a shared host so will never have server root).