Fatal Error caused by require_once()
-
Hey, terrific work on the oembed repeater! I’ve been testing it locally and it was working like a charm. When I pushed up to a staging server it was spitting out a fatal error:
Warning: require_once(__DIR__/oembed-ajax.php) [function.require-once]: failed to open stream: No such file or directory in /###/###/public_html/###/wp-content/plugins/advanced-custom-fields-oembed-field/acf-oembed.php on line 41
Fatal error: require_once() [function.require]: Failed opening required ‘__DIR__/oembed-ajax.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /###/###/public_html/###/wp-content/plugins/advanced-custom-fields-oembed-field/acf-oembed.php on line 41
I was able to fix the problem by editing acf-oembed.php in the __consrtuct() function.
Replace Line 41:
//register ajax handler require_once( __DIR__ . '/oembed-ajax.php' );
with:
//register ajax handler require_once(dirname(__FILE__) . '/oembed-ajax.php' );
That should solve that little bug, hope that helps!
https://www.ads-software.com/plugins/advanced-custom-fields-oembed-field/
- The topic ‘Fatal Error caused by require_once()’ is closed to new replies.