mediawiki Fatal error: require_once(): Failed opening required after server moved - php

When I moved MediaWiki from Localhost to the server I started getting the below error. I am using the latest version and tried to use php 5.3, 5.4 and 5.5 but error exists for all version of php. I know this might not be php version related but just cross checked.
Warning:
require_once(/home/meuser/public_html/site_dir\extensions\Cite\Cite.php):
failed to open stream: No such file or directory in
/home/meuser/public_html/site_dir/LocalSettings.php on line 132
Fatal error: require_once(): Failed opening required '/home/meuser/public_html/site_dir\extensions\Cite\Cite.php'
(include_path='.:/opt/php54/lib/php') in
/home/meuser/public_html/site_dir/LocalSettings.php on line 132
When I commented Cite extension (to disable the extension) to cross check, it gives the same error for the next extension. So I believe there is something wrong in moving server?
I have just uploaded all files to the server and changed database and site url settings in Localsettings.php and imported database.
Is there any extra step required?

There's an issue with the directory separators in your paths. Notice how they're all forward slashes until you reach site_dir. Fix these and it should work perfectly. Based on this code the paths you need to change are in LocalSettings.php

i think this will help you
Syntax:
require_once($_SERVER['DOCUMENT_ROOT']./your file location with only '/' slash);
ie.,
require_once($_SERVER['DOCUMENT_ROOT']./site_dir/extensions/Cite/Cite.php);

Related

Use php require for local directory

I have recently been trying to add PHPMailer script to my site, following the accepted answer from here:
Send attachments with PHP Mail()?
I have never used a require statment before so I assume I must be doing it wrong, currently testing on my local host version of the site. I have downloaded the entire zip of git (unzipped it) and moved it to the dir my scripts are in.
In my script I added the following line:
require_once(__DIR__.'/PHPMailer-master/class.phpmailer.php');
Which to my understanding was all I needed to do to use it. However I get this error:
Warning:
require_once(C:\xampp\htdocs\Website\PHPMailer-master\class.phpmailer.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\Website\include\mailer.php on line 10
Fatal error: require_once(): Failed opening required
'C:\xampp\htdocs\Website\PHPMailer-master\class.phpmailer.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\Website\include\mailer.php on line 10
Any ideas what is causing this error? Am running PHP 5.6.21 if this is relevant.
Try to use the full path to the file, using realpath() - http://php.net/realpath, and use dirname(__FILE__) to get your current directory:

MediaWiki 1.27 warning requiring SpecialUserLogin.php

I've updated my mediawiki from 1.26.2 to 1.27, the installation process finished ok, but when I try to access I received this error:
Warning:
require(/var/app/current/includes/specials/SpecialUserLogin.php):
failed to open stream: No such file or directory in
/var/app/current/includes/AutoLoader.php on line 81 Fatal error:
require(): Failed opening required
'/var/app/current/includes/specials/SpecialUserLogin.php'
(include_path='/var/app/current/vendor/pear/pear_exception:/var/app/current/vendor/pear/console_getopt:/var/app/current/vendor/pear/pear-core-minimal/src:/var/app/current/vendor/pear/mail_mime:/var/app/current/vendor/pear/mail_mime-decode:/var/app/current/vendor/pear/net_socket:/var/app/current/vendor/pear/net_smtp:/var/app/current/vendor/pear/mail:.:/usr/share/pear:/usr/share/php')
in /var/app/current/includes/AutoLoader.php on line 81
I have no idea why is this happening. If I check the files in my server they're there. I'm also having template issues if I choose vector I only get a messed up template, without styling.
I'm using PHP 5.6.
I hope someone can help me.
I just stumbled across this same exact error after upgrading to MW 1.27.
In my case, the SpecialUserlogin.php existed and all of the permissions were right BUT the word login was written in lowercase so the system thought this file didn't exist. So I just renamed the SpecialUserlogin.php to SpecialUserLogin.php and b00m, it worked!
As for your templating issues, check the common.css file. Copy paste everything out of there, so it's empty, if you don't use it. And check that you're calling your style files correctly in your template.

Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in ......?

I moved wordpress from one server to other...home page is running fine but when I click to category pages/links it shows these errors
Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/server/public_html/index.php on line 17
Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in /home/server/public_html/index.php on line 17
Fatal error: require() [function.require]: Failed opening required './wp-blog-header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/server/public_html/index.php on line 17
I searched on google and tried accordingly but not solved. I tried wp-codex tech like http://codex.wordpress.org/Changing_The_Site_URL but also failed. I have the wp-blog-header file in my directory but still not working....any help ...thanx in advance
Change php version for 7. My tech.support make this and problem was done
I had a similar issue and the problem was with the PHP version used which in my case by default was PHP 5.2 and it was throwing the 500 status code error.
When upgrading the PHP version to 5.3 the 500 status code was gone but Wordpress returned this error:
Your server is running PHP version 5.3.29 but WordPress 5.4.2 requires at least 5.6.20.
Note to myself (and everyone else with this error): When moving Wordpress websites between different servers make sure you are running the minimum required PHP version.
Also remember:
Note: If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP 5.6.20+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities.
According to WP docs the recommended PHP is version 7.3.
Try the default theme and see if you still have the error. If so the theme you are using is causing the error - as in my case. The page that had an error was calling a file in "pages" that was not there. When I changed what is to show on that page to something current - the error went

Warning: require(__DIR__/warp.php) - Switching Site from one server to another

I am switching over a website that was built on Wordpress from one HostGator server to another HostGator server. I have successfully transferred over the files via FTP, and migrated the MySQL database over and have both connected successfully.
I am running into an issue when I view the site in the browser and I receive this following error message:
Warning: require(DIR/warp.php) [function.require]: failed to open stream: No such file or directory in /home/abcworld/public_html/new2/wp-content/themes/yoo_moustache_wp1/index.php on line 10
Warning: require(DIR/warp.php) [function.require]: failed to open stream: No such file or directory in /home/abcworld/public_html/new2/wp-content/themes/yoo_moustache_wp1/index.php on line 10
Fatal error: require() [function.require]: Failed opening required 'DIR/warp.php' (include_path='.:/opt/php52/lib/php') in /home/abcworld/public_html/new2/wp-content/themes/yoo_moustache_wp1/index.php on line 10
When I switch to the themes that comes with Wordpress, the site is displayed with the data that is in the MySQL database, so it seems that the Template is what's causing the error. I am using a Yootheme Template called 'Moustache' and have downloaded the latest version and uploaded it to Wordpress and the error message is still there.
The site I am working on is: http://abcworldwidestone.com/new2/
I am unsure what's causing this and would love some assistance - Any thoughts?
Your server must still be using PHP 5.2 , use 5.3.3 or higher at least.
As per the documentation;
5.3.0 Added DIR and NAMESPACE constants
You are more than likely running PHP version < 5.3.0.

Two Errors trying to include .php file: Warning: require(...) AND Fatal error: require() ... (include_path='.;C:\php\pear')

Here is the first error:
Warning: require(/hb/includes/constants.php) [function.require]: failed to open stream: No such file or directory in C:\wamp2\www\hb\includes\connection.php on line 2
And the second error that immediately follows:
Fatal error: require() [function.require]: Failed opening required '/hb/includes/constants.php' (include_path='.;C:\php\pear') in C:\wamp2\www\hb\includes\connection.php on line 2
Here is the line that it doesn't like:
require("/hb/includes/constants.php");
I did install a new version of WAMP, but I know the directories/files are fine and the code worked previously and on another server. It seems like none of my require()'s are working anymore. I tried looking around and some suggested to others that they edit their php.ini, but I don't know what directory I would point to - if you can't tell I'm pretty noobish regarding all things server related.
Any help is appreciated.
First of all, are your really -- really ! -- sure that the file /hb/includes/constants.php, that your are trying to include, exists ?
Considering that the path you requested begins with a /, it looks like you're using an absolute path... that looks like an UNIX path, but you are on a Windows server...
If it exists, and PHP still cannot include it, check :
that it is readable by your webserver (including the directories) -- I'm thinking about UNIX permissions
that there is no open_basedir restriction that would prevent PHP from accessing those files.
BTW, having a warning and a fatal error is the behavior that's to be expected when using require : the warning is normal (it comes from include) ; and the fatal error is the difference between include and require.

Categories