Joomla 3 is giving error after changing hosting company - php

I have developed new website in Joomla 3 and now want to transfer it to new hosting and domain.
I have copied all files and directories and created databases. Also changed configuration file.
The problem is that new hosting company runs PHP 5.2.17 version and I removed this string in index.php where it is checking for php version.
After that I have strange error
Warning: require_once(__DIR__/includes/defines.php) [function.require-once]: failed to open stream: No such file or directory in /usr/.../public_html/index.php on line 28
Fatal error: require_once() [function.require]: Failed opening required '__DIR__/includes/defines.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /usr/.../public_html/index.php on line 28
How can I fix it? Thanks in advance. I can not use php.ini and changing hosting company is big problem.

Minimum requirement of PHP version is PHP 5.3 for Joomla 3. So you should upgrade your PHP version otherwise use Joomla 2.5
You may get other issues also, if you use Joomla 3 on PHP 5.2. To fix this issue you need to replace __DIR__ with dirname(__FILE__)

The version check isn't just for show. Requirements for Joomla 3.* is PHP 5.3.1 or higher.
Even if you fix what bugs you find now, you will definitely encounter problems later if you do not upgrade the PHP version.
Just to get an idea of how ugly things can get - check the PHP changelog. There are a lot of changes in 5.3.0 and 5.3.1, and any of them can cause unexpected behavior.

Related

My Joomla site shows PHP error: failed to open stream

I am working on a Joomla site, and just recently updated PHP to 7.2, but my site started throwing errors. I have also updated Joomla to the latest version, but errors still appear. I'm not good in PHP and don't know how to fix it.
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Color has a deprecated constructor in /public_html/templates/jf_social/features/color.php on line 11
Warning: require_once(/public_html/libraries/joomla/document/html/renderer/head.php): failed to open stream: No such file or directory in /public_html/templates/jf_social/error.php on line 52
Fatal error: require_once(): Failed opening required '/public_html/libraries/joomla/document/html/renderer/head.php' (include_path='.:/php:/opt/cpanel/ea-php73/root/usr/share/pear') in /public_html/templates/jf_social/error.php on line 52
I think error comes from my Joomla template, I am using this one https://www.joomforest.com/joomla/templates/jf-social
I can't receive support from that template developers, because my subscription is expired, and changing the template will take a lot of time for me,
can you please anyone advise how to fix it?
Thank you very much!
Try to delete the line 52
require_once(/public_html/libraries/joomla/document/html/renderer/head.php)
from the File
/public_html/templates/jf_social/error.php
The renderer/head.php doesnt be supported any more in your joomla version. If there are no more errors, everything is fine, if not your template is not supported any more.
Then go to the file
/public_html/templates/jf_social/features/color.php
and edit the line
function Color($hex){
to
function __construct($hex){

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.

Installing PEAR in Windows Server 2008, PLESK

I'm not one to normally reach out but I've found myself completely stumped by this one.
I have a new server and chose to go with Windows Server 2008 and Plesk. After importing my site, I find that my includes no longer work, coming up with this error message:
require_once(include/online_class.php) [function.require-once]: failed to open stream: Operation not permitted
Fatal error: require_once() [function.require]: Failed opening required 'include/online_class.php
I have disabled open_basedir to make sure that it isn't conflicting but I am still getting this message. I have tried doing a fresh install of PEAR via command line and have made sure include_path points to the correct directory -> C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR
I have switched between both PHP 5.2 and 5.3 - 5.3 will just display a 500 error message without even reaching the php include errors.
Is there something I'm missing here? This is an issue I've never had with linux / cpanel builds and it's leaving a sour taste in my mouth with regards to Windows servers. What can I do to fix this problem?
Any help would be appreciated. Cheers!

Categories