Includes Define.php error on J2.5 webpage

General questions relating to Joomla! 2.5. Note: All 1.6 and 1.7 releases have reached end of life and should be updated to 2.5. There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Includes Define.php error on J2.5 webpage

Post by Ginza » Tue Dec 30, 2014 4:01 pm

My web hosting recently migrated to a new server. Ever since they moved, I got php error every now and then. I logged ticket with them however they are clueless and asked me to contact developer. There was no issues prior to the migration. Below is the error on my index.php page. Please check and see if it is something I can resolve from my end.

Code: Select all

Warning: require_once(/home/website/public_html/includes/defines.php) [function.require-once]: failed to open stream: No such file or directory in /home/website/public_html/index.php on line 18

Fatal error: require_once() [function.require]: Failed opening required '/home/website/public_html/includes/defines.php' (include_path='.:/usr/local/altphp/lib/php') in /home/website/public_html/index.php on line 18
Coming Soon!

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Tue Dec 30, 2014 6:27 pm

The file /includes/defines.php is missing from the Joomla folder. You can find it from the installation archive. Copy it to the server to the subfolder includes in the main Joomla folder. If more similar errors occur, it is best to copy all the files.
Toivo Talikka, Global Moderator

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Includes Define.php error on J2.5 webpage

Post by Ginza » Tue Dec 30, 2014 9:32 pm

toivo wrote:The file /includes/defines.php is missing from the Joomla folder. You can find it from the installation archive. Copy it to the server to the subfolder includes in the main Joomla folder. If more similar errors occur, it is best to copy all the files.
Thank you. Let me try.
Coming Soon!

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Includes Define.php error on J2.5 webpage

Post by Ginza » Tue Dec 30, 2014 9:47 pm

The above error is being fixed. But now I got the following error in the backend when I try to post a new article

Code: Select all

Notice: Constant JPATH_ROOT already defined in /home/mysite/public_html/includes/defines.php on line 21

Notice: Constant JPATH_SITE already defined in /home/mysite/public_html/includes/defines.php on line 23

Notice: Constant JPATH_CONFIGURATION already defined in /home/mysite/public_html/includes/defines.php on line 24

Notice: Constant JPATH_ADMINISTRATOR already defined in /home/mysite/public_html/includes/defines.php on line 25

Notice: Constant JPATH_LIBRARIES already defined in /home/mysite/public_html/includes/defines.php on line 26

Notice: Constant JPATH_PLUGINS already defined in /home/mysite/public_html/includes/defines.php on line 27

Notice: Constant JPATH_INSTALLATION already defined in /home/mysite/public_html/includes/defines.php on line 28

Notice: Constant JPATH_THEMES already defined in /home/mysite/public_html/includes/defines.php on line 29

Notice: Constant JPATH_CACHE already defined in /home/mysite/public_html/includes/defines.php on line 30

Notice: Constant JPATH_MANIFESTS already defined in /home/mysite/public_html/includes/defines.php on line 31
Coming Soon!

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Wed Dec 31, 2014 8:41 am

As a workaround, change the error reporting option in Global Configuration - Server to 'Simple' and these notices will not get reported.

Have you modified the file administrator/index.php? Otherwise these notices would not appear.
Toivo Talikka, Global Moderator

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Includes Define.php error on J2.5 webpage

Post by Ginza » Wed Dec 31, 2014 10:16 am

Thank you. I didnt modify the administrator's index file. But the template index file was modified.

I replaced the administrator's index file with a fresh file, but it shows the same.

What do you suggest?
Coming Soon!

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Wed Dec 31, 2014 11:30 am

Somewhere, probably in your template, the following line or a similar one must have been added so that it causes the notices:

Code: Select all

require JPATH_BASE.'/includes/defines.php';
Toivo Talikka, Global Moderator

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Includes Define.php error on J2.5 webpage

Post by Ginza » Wed Dec 31, 2014 12:10 pm

thank you. I will look it up.

Is this something that can create problem with the website? Or can it be ignored?
Coming Soon!

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Wed Dec 31, 2014 1:00 pm

Notices are usually harmless and only an indication of obsolete code and slack testing. You can suppress them in the php.ini file or in the error reporting option in Global Configuration - Server.

In this case the duplication of the definitions of the constants in includes/defines.php in the back end is strange and would indicate some incompatibility or corruption in the code.
Toivo Talikka, Global Moderator

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Includes Define.php error on J2.5 webpage

Post by Ginza » Wed Dec 31, 2014 2:34 pm

Thank you.

Happy New Year to you!
Coming Soon!

Scott235
Joomla! Explorer
Joomla! Explorer
Posts: 433
Joined: Tue Apr 07, 2009 7:58 pm

Re: Includes Define.php error on J2.5 webpage

Post by Scott235 » Thu Nov 19, 2015 9:02 pm

Hello:
I'm getting the same errors but a lot more.

The errors are happening on my client's old site which is now located at oldsite.domain.com

It was at www.domain.com but now there's a new site at this location.

I opened this file, includes/defines.php and saw this:

define('JPATH_SITE', JPATH_ROOT);
define('JPATH_CONFIGURATION', JPATH_ROOT);
define('JPATH_ADMINISTRATOR', JPATH_ROOT . '/administrator');
define('JPATH_LIBRARIES', JPATH_ROOT . '/libraries');
define('JPATH_PLUGINS', JPATH_ROOT . '/plugins' );
define('JPATH_INSTALLATION', JPATH_ROOT . '/installation');
define('JPATH_THEMES', JPATH_BASE . '/templates');
define('JPATH_CACHE', JPATH_BASE . '/cache');
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . '/manifests');

I changed them to where the old site is now. Will this fix it where the errors will be gone?

define('JPATH_SITE', JPATH_ROOT);
define('JPATH_CONFIGURATION', JPATH_ROOT);
define('JPATH_ADMINISTRATOR', JPATH_ROOT . '/administrator');
define('JPATH_LIBRARIES', JPATH_ROOT . 'oldsite.domain.com/libraries');
define('JPATH_PLUGINS', JPATH_ROOT . 'oldsite.domain.com/plugins' );
define('JPATH_INSTALLATION', JPATH_ROOT . 'oldsite.domain.com/installation');
define('JPATH_THEMES', JPATH_BASE . 'oldsite.domain.com/templates');
define('JPATH_CACHE', JPATH_BASE . 'oldsite.domain.com/cache');
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . 'oldsite.domain.com/manifests');

Should I change these too?
define('JPATH_SITE', JPATH_ROOT);
define('JPATH_CONFIGURATION', JPATH_ROOT);
define('JPATH_ADMINISTRATOR', JPATH_ROOT . '/administrator');

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Thu Nov 19, 2015 9:24 pm

None of those entries should be changed. Something else has gone wrong.

Even if the old site may reside in a sub folder, both sites should rely on their own file systems.
Toivo Talikka, Global Moderator

Scott235
Joomla! Explorer
Joomla! Explorer
Posts: 433
Joined: Tue Apr 07, 2009 7:58 pm

Re: Includes Define.php error on J2.5 webpage

Post by Scott235 » Thu Nov 19, 2015 9:54 pm

toivo wrote:None of those entries should be changed. Something else has gone wrong.

Even if the old site may reside in a sub folder, both sites should rely on their own file systems.
Here's only some of the errors I'm getting:

Warning: require_once(/home/account/public_html/oldsite/includes/defines.php): failed to open stream: No such file or directory in /home/account/public_html/oldsite/index.php on line 18 Fatal error: require_once(): Failed opening required '/home/account/public_html/oldsite/includes/defines.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/account/public_html/oldsite/index.php on line 18

I put up a new site for a client and using this as an example www.domain.com

The client's former site to use as a backup if necessary was put up as a sub domain, oldsite.domain.com

When I try to access oldsite.domain.com I get a bunch of errors such as this one and many others. Also when I try to access any of the internal pages, that's not working either.

Any ideas or suggestions on how to fix this?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Thu Nov 19, 2015 11:23 pm

Make sure the file oldsite/includes/defines.php is there and accessible.
Toivo Talikka, Global Moderator

Scott235
Joomla! Explorer
Joomla! Explorer
Posts: 433
Joined: Tue Apr 07, 2009 7:58 pm

Re: Includes Define.php error on J2.5 webpage

Post by Scott235 » Thu Nov 19, 2015 11:27 pm

Ok, I'll check. If its there and accessible and still showing the errors then what?

Also when I go to oldsite.domain.com its redirecting to www.domain.com/oldsite/
Why is it doing that?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Thu Nov 19, 2015 11:31 pm

Also when I go to oldsite.domain.com its redirecting to http://www.domain.com/oldsite/
What did you do to redirect the old site to oldsite.domain.com?
Toivo Talikka, Global Moderator

Scott235
Joomla! Explorer
Joomla! Explorer
Posts: 433
Joined: Tue Apr 07, 2009 7:58 pm

Re: Includes Define.php error on J2.5 webpage

Post by Scott235 » Thu Nov 19, 2015 11:50 pm

toivo wrote:
Also when I go to oldsite.domain.com its redirecting to http://www.domain.com/oldsite/
What did you do to redirect the old site to oldsite.domain.com?
I created a new sub domain, uploaded the files, set up an A record, that's it.

I'm getting these errors plus many more too:

Strict Standards: Only variables should be assigned by reference in /home/radataco/public_html/oldsite/plugins/system/jat3/jat3.php on line 41 Strict Standards: Declaration of JParameter::loadSetupFile() should be compatible with JRegistry::loadSetupFile() in /home/radataco/public_html/oldsite/libraries/joomla/html/parameter.php on line 512 Strict Standards: Non-static method T3Common::get_active_template() should not be called statically in /home/radataco/public_html/oldsite/plugins/system/jat3/jat3/core/define.php on line 16 Strict Standards: Non-static method JAT3_AdminUtil::get_active_template() should not be called statically in /home/radataco/public_html/oldsite/plugins/system/jat3/jat3/core/common.php on line 83 Strict Standards: Non-static method JAT3_AdminUtil::checkPermission() should not be called statically, assuming $this from incompatible context in /home/radataco/public_html/oldsite/plugins/system/jat3/jat3.php on line 166 Strict Standards: Only variables should be assigned by reference in /home/radataco/public_html/oldsite/plugins/system/vmbfcustomfields/vmbfcustomfields.php on line 177 Strict Standards: Only variables should be assigned by reference in /home/radataco/public_html/oldsite/plugins/system/siteapps4joomla/siteapps4joomla.php on line 24 Strict Standards: Only variables should be assigned by reference in /home/radataco/public_html/oldsite/plugins/system/googleanalytics4joomla/googleanalytics4joomla.php on line 23 Strict Standards: Non-static method T3Common::detect() should not be called statically, assuming $this from incompatible context in /home/radataco/public_html/oldsite/plugins/system/jat3/jat3.php on line 85 Strict Standards: Non-static method T3Path::path() should not be called statically, assuming $this from incompatible context in /home/radataco/public_html/oldsite/plugins/system/jat3/jat3/core/common.php on line 69

Scott235
Joomla! Explorer
Joomla! Explorer
Posts: 433
Joined: Tue Apr 07, 2009 7:58 pm

Re: Includes Define.php error on J2.5 webpage

Post by Scott235 » Sat Nov 21, 2015 6:09 pm

Something occurred to me about this.

This old site which was using Joomla 2.x was on a server using the PHP version that Joomla 2.5 was able to run on.
This same old site was moved to a different hosting which uses a much more current version of PHP to be compatible with Joomla 3.x because the client's new site was built on 3.x
The client wants to see and reference the old site to pull info from it.
Could it be that because the server has a newer version of PHP its incompatible with Joomla 2.x and why we're getting all these errors?

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17431
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Includes Define.php error on J2.5 webpage

Post by toivo » Sat Nov 21, 2015 7:32 pm

You can try fine tuning the error reporting in the main php.ini file or a local php.ini file to filter Strict Standards messages, or just change the error reporting option in Global Configuration to 'None'.
Toivo Talikka, Global Moderator

Scott235
Joomla! Explorer
Joomla! Explorer
Posts: 433
Joined: Tue Apr 07, 2009 7:58 pm

Re: Includes Define.php error on J2.5 webpage

Post by Scott235 » Sat Nov 21, 2015 8:37 pm

toivo wrote:You can try fine tuning the error reporting in the main php.ini file or a local php.ini file to filter Strict Standards messages, or just change the error reporting option in Global Configuration to 'None'.
Global Configuration to 'None' - that worked perfectly, thanks. Much easier to do this then edit the ini files and I wouldn't even know what to edit and change.


Locked

Return to “General Questions/New to Joomla! 2.5”