PHP: Error using include_once function. Failed opening 'mysiteURL' for inclusion - wordpress

I have never used PHP and need it just to build my WordPress site with an installed theme.
Every time when I open any pages under my wp-admin, I'm getting a warning:
Warning: include_once(): Failed opening
‘/myURL/public_html/wp-content/plugins/dsidxpress/admin.php’
for inclusion (include_path=’.:/usr/local/php56/pear’) in
/myURL/public_html/wp-content/plugins/dsidxpress123/dsidxpress.php
on line 90
When opening .php, I see the following code on line 90:
include_once(str_replace("\\", "/", WP_PLUGIN_DIR) . "/dsidxpress/admin.php");
After changing it per the instrucions:
include_once(include_path='.:/usr/local/php56/pear' . “/dsidxpress/admin.php”);
I'm getting new error:
Parse error: syntax error, unexpected ‘=’ in /myURL/public_html/wp-content/plugins/dsidxpress123/dsidxpress.php on line 90
How exactly do I need to change it?

Related

I am having the issue in wp site

I am having the following issue in wp site.
Warning: include(/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache-base.php): failed to open stream: No such file or directory in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 65
Warning: include(): Failed opening '/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 65
Warning: include_once(/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/ossdl-cdn.php): failed to open stream: No such file or directory in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 82
Warning: include_once(): Failed opening '/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/ossdl-cdn.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 82
Warning: Cannot modify header information - headers already sent by (output started at /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php:65) in /home/ngohost/public_html/artfinteriors.com/wp-includes/pluggable.php on line 1179
It seems that you are using WP Super Cache plugin and this is causing the errors. The first step for debugging is to try to deactivate / uninstall the plugin and see if the error still appear.

Can't perform require once in WordPress without displaying the path on the page

Followng accepted answers given here I used the following to call some PHP code on my home page:
require_once (bloginfo('template_directory') . '/home_bloc_horaires.php');
It works, but it also actually displays the path of my template directory on my page! Any way to avoid this?
EDIT:
Tried require_once(get_template_directory().'/home_bloc_horaires.php'); : it doesn't work and I get the following error messages:
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
Warning: include(http://127.0.0.1/wordpress/mirail/wp-content/themes/mmt-2014/home_bloc_horaires.php): failed to open stream: no suitable wrapper could be found in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
Warning: include(): Failed opening 'http://127.0.0.1/wordpress/mirail/wp-content/themes/mmt-2014/home_bloc_horaires.php' for inclusion (include_path='.;C:\php\pear') in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
bloginfo() outputs the result, which is why you can see it. Use this instead:
require_once(get_template_directory().'/home_bloc_horaires.php');
You can find more info on loading files in WordPress here.

Unable to view Wordpress site

I had created a wordpress site close to 6 months back. Everything was fine till a few days back when we started to see the Wordpress "White Screen of Death" both at the front and back end.
After a lot of debug attempts, we decided to re-install wordpress and keep the old wp-content file.
Now this is visible on trying to access the site(wp_debug is set to false, so ideally it shouldn't be happening) -
Warning: require(/home/vaidya/public_html/wp-includes/class-wp-error.php) [function.require]: failed to open stream: No such file or directory in /home/vaidya/public_html/wp-settings.php on line 74
Fatal error: require() [function.require]: Failed opening required '/home/vaidya/public_html/wp-includes/class-wp-error.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/vaidya/public_html/wp-settings.php on line 74
Line 74 on wp-settings -
require( ABSPATH . WPINC . '/class-wp-error.php' );
Any suggestions?
The error message says, the the file "class-wp-error.php" is missing.
It should be located in the folder "'/home/vaidya/public_html/wp-includes/". It seems that you did not copy all required files.

WordPress error with require_once

I have this error in my wordpress, on frontend and dashboard:
Warning: require_once(includes/theme-widgets.php) [function.require-once]: failed to open stream: No such file or directory in /home/masqueci/public_html/functions.php on line 2
Fatal error: require_once() [function.require]: Failed opening required 'includes/theme-widgets.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/masqueci/public_html/functions.php on line 2
The problem is that I try to delete this line, rename the file, delete the all theme and delete wp-admin and wp-include and upload it again. But the error continue. How can I fix this problem?
Your problem is that you are using a worng reletive path to the file wanted.
Try on using:
$filePath = get_bloginfo('template_url'); // this line gets you the path to the current theme.
$filePath .= 'includes/theme-widgets.php'; // now we add the relative path to your file
require_once($filePath); // now we place the hole thing inside the 'require_once' function.
now you can minimize the code by:
require_once(get_bloginfo('template_url').'includes/theme-widgets.php');
what was originally responded by the function was that it was trying on going to:
public_html/includes/theme-widgets.php which did not exist while your path was:
public_html/wp-content/themes/{theme_name}/includes/theme-widgets.php
The code i have provided before should do the job for you :)

Zend Autoloader.php file missing?

I'm using a Wordpress plugin Zend Framework for wordpress and I'm downloading the actual Zend library to plug it into the plugin (it doesn't provide by itself) from http://framework.zend.com/downloads/archives
Error:
Warning: require_once(Zend/Loader/Autoloader.php): failed to open stream: No such file or directory in C:\localhost\~\wp-content\plugins\zend-framework-wp\zend-framework.php on line 28
Fatal error: require_once(): Failed opening required 'Zend/Loader/Autoloader.php' (include_path='.;C:\php\pear;C:\localhost\~\wp-content\plugins\zend-framework-wp') in C:\localhost\~\wp-content\plugins\zend-framework-wp\zend-framework.php on line 28
zend-framework.php, line 28
function zend_framework_register_autoload()
{
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
}
There's no Zend/Loader/Autoloader.php.
There's a AutoloaderFactory.php, StandardAutoloader.php... I tried renaming them to Autoloader.php but ran into more errors,
Fatal error: Class 'Zend_Loader_Autoloader' not found in C:\localhost\~\wp-content\plugins\zend-framework-wp\zend-framework.php on line 29
I guess that's not the way to go.
What's going wrong?
edit: I've cross-posted to wordpress.stack

Resources