J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance errors

Need help upgrading your Joomla! website or converting to Joomla! 3.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
YOLO
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Nov 14, 2013 11:23 am

J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance errors

Post by YOLO » Fri Nov 15, 2013 10:00 am

Hi.

After installing J! 3.2 many system plugins on my site stopped working. I rolled back to 3.1.6 and plugins started working again, but then I got several issues. Entering any component, article, module, plugin, etc. shows this error in the backend:

Code: Select all

Error
JForm::getInstance could not load file
This happens randomly. Sometimes after refreshing a few times it starts working but errors come back soon. With PHP error display turned on I get many simplexml_load_file() errors like this:

Code: Select all

Warning: simplexml_load_file(): I/O warning : failed to load external entity "/home/example/domains/example.com/public_html/language/en-GB/en-GB.xml" in /home/example/domains/example.com/public_html/libraries/joomla/language/language.php on line 1305
When I try to update or downgrade Joomla, install or uninstall any extension I get this:

Code: Select all

Warning
JInstaller: :Install: Cannot find Joomla XML setup file
I decided to try a fresh installation on a subdomain but keep getting many errors like these:

Code: Select all

Warning: simplexml_load_file(): I/O warning : failed to load external entity "/home/example/domains/example.com/public_html/j/installation/localise.xml" in /home/example/domains/example.com/public_html/j/installation/application/web.php on line 284

Warning: simplexml_load_file(): I/O warning : failed to load external entity "/home/example/domains/example.com/public_html/j/installation/language/en-AU/en-AU.xml" in /home/example/domains/example.com/public_html/j/libraries/joomla/language/language.php on line 1354
Running on Apache 2, PHP 5.5.1 and 5.4.17. Host allows switching between PHP versions. Switching from one PHP version to another removes errors but only temporarily.

Here's my FPA from freshly uploaded Joomla! 3.2 folder:
Forum Post Assistant (v1.2.3) : 15th November 2013 wrote:
Basic Environment :: wrote:Joomla! Instance :: Joomla! 3.2.0-Stable (Ember) 6-November-2013
Joomla! Platform :: Joomla Platform 13.1.0-Stable (Curiosity) 24-Apr-2013
Joomla! Configured :: Not Found

Host Configuration :: OS: Linux | OS Version: 2.6.32-042stab078.28 | Technology: x86_64 | Web Server: Apache | Encoding: gzip, deflate | Doc Root: /home/example/domains/example.com/public_html/j | System TMP Writable: Yes

PHP Configuration :: Version: 5.4.17 | PHP API: cgi-fcgi | Session Path Writable: Yes | Display Errors: 1 | Error Reporting: 22519 | Log Errors To: | Last Known Error: | Register Globals: | Magic Quotes: | Safe Mode: | Open Base: /home/example/:/tmp:/usr/share/pear54 | Uploads: 1 | Max. Upload Size: 32M | Max. POST Size: 32M | Max. Input Time: 60 | Max. Execution Time: 30 | Memory Limit: 128M

MySQL Configuration :: Database Credentials incomplete or not available Nothing to display.
Missing credentials detected: Connection Type missing | MySQL Host missing | Table Prefix missing | Database Username missing | Database Password missing |
Detailed Environment :: wrote:PHP Extensions :: Core (5.4.17) | date (5.4.17) | ereg () | libxml () | openssl () | pcre () | sqlite3 (0.7) | zlib (2.0) | bcmath () | calendar () | ctype () | curl () | dom (20031129) | enchant (1.1.0) | hash (1.0) | fileinfo (1.0.5) | filter (0.11.0) | ftp () | gd () | gettext () | SPL (0.2) | iconv () | session () | intl (1.1.0) | json (1.2.1) | mbstring () | mcrypt () | standard (5.4.17) | mysqlnd (mysqlnd 5.0.10 - 20111026 - $Id: e707c415db32080b3752b232487a435ee0372157 $) | mysqli (0.1) | mysql (1.0) | PDO (1.0.4dev) | pdo_mysql (1.0.2) | pdo_sqlite (1.0.1) | apc (3.1.13) | pspell () | Reflection ($Id: 6c4d8062369898a397e4b128348042f5c01b4427 $) | imap () | SimpleXML (0.1) | soap () | sockets () | exif (1.4 $Id$) | tidy (2.0) | tokenizer (0.1) | wddx () | xml () | xmlreader (0.1) | xmlwriter (0.1) | xsl (0.1) | zip (1.11.0) | cgi-fcgi () | Phar (2.0.1) | mhash () | ionCube Loader () | Zend Engine (2.4.0) |
Potential Missing Extensions :: suhosin |

Switch User Environment (Experimental) :: PHP CGI: Yes | Server SU: No | PHP SU: Yes | Custom SU (LiteSpeed/Cloud/Grid): No
Potential Ownership Issues: Maybe
Folder Permissions :: wrote:Core Folders :: images/ (755) | components/ (755) | modules/ (755) | plugins/ (755) | language/ (755) | templates/ (755) | cache/ (755) | logs/ (755) | tmp/ (755) | administrator/components/ (755) | administrator/modules/ (755) | administrator/language/ (755) | administrator/templates/ (755) |

Elevated Permissions (First 10) ::
Extensions Discovered :: wrote:Components :: SITE :: com_wrapper (3.0.0) | com_mailto (3.0.0) |
Components :: ADMIN :: com_search (3.0.0) | com_redirect (3.0.0) | com_weblinks (3.0.0) | com_modules (3.0.0) | com_joomlaupdate (3.0.0) | com_installer (3.0.0) | com_cpanel (3.0.0) | com_config (3.0.0) | com_categories (3.0.0) | com_templates (3.0.0) | com_tags (3.1.0) | com_content (3.0.0) | com_banners (3.0.0) | com_postinstall (3.2.0) | com_users (3.0.0) | com_contenthistory (3.2.0) | com_messages (3.0.0) | com_ajax (3.2.0) | com_checkin (3.0.0) | com_cache (3.0.0) | com_newsfeeds (3.0.0) | com_login (3.0.0) | com_admin (3.0.0) | com_media (3.0.0) | com_menus (3.0.0) | com_finder (3.0.0) | com_plugins (3.0.0) | com_languages (3.0.0) |

Modules :: SITE :: mod_feed (3.0.0) | mod_articles_categories (3.0.0) | mod_random_image (3.0.0) | mod_tags_similar (3.1.0) | mod_search (3.0.0) | mod_menu (3.0.0) | mod_login (3.0.0) | mod_whosonline (3.0.0) | mod_users_latest (3.0.0) | mod_tags_popular (3.1.0) | mod_stats (3.0.0) | mod_custom (3.0.0) | mod_syndicate (3.0.0) | mod_articles_news (3.0.0) | mod_weblinks (3.0.0) | mod_articles_popular (3.0.0) | mod_languages (3.0.0) | mod_footer (3.0.0) | mod_breadcrumbs (3.0.0) | mod_wrapper (3.0.0) | mod_articles_category (3.0.0) | mod_articles_archive (3.0.0) | mod_finder (3.0.0) | mod_banners (3.0.0) | mod_related_items (3.0.0) | mod_articles_latest (3.0.0) |
Modules :: ADMIN :: mod_feed (3.0.0) | mod_version (3.0.0) | mod_latest (3.0.0) | mod_stats_admin (3.0.0) | mod_menu (3.0.0) | mod_multilangstatus (3.0.0) | mod_login (3.0.0) | mod_logged (3.0.0) | mod_status (3.0.0) | mod_submenu (3.0.0) | mod_custom (3.0.0) | mod_quickicon (3.0.0) | mod_popular (3.0.0) | mod_title (3.0.0) | mod_toolbar (3.0.0) |

Plugins :: SITE :: plg_finder_newsfeeds (3.0.0) | plg_finder_contacts (3.0.0) | plg_finder_tags (3.0.0) | plg_finder_weblinks (3.0.0) | plg_finder_categories (3.0.0) | plg_finder_content (3.0.0) | plg_authentication_gmail (3.0.0) | plg_authentication_joomla (3.0.0) | plg_authentication_cookie (3.0.0) | plg_authentication_ldap (3.0.0) | plg_editors-xtd_readmore (3.0.0) | plg_editors-xtd_pagebreak (3.0.0) | plg_editors-xtd_image (3.0.0) | plg_editors-xtd_article (3.0.0) | plg_quickicon_joomlaupdate (3.0.0) | plg_quickicon_extensionupdate (3.0.0) | plg_extension_joomla (3.0.0) | plg_search_newsfeeds (3.0.0) | plg_search_contacts (3.0.0) | plg_search_weblinks (3.0.0) | plg_search_categories (3.0.0) | plg_search_content (3.0.0) | plg_captcha_recaptcha (3.0.0) | plg_twofactorauth_totp (3.2.0) | plg_twofactorauth_yubikey (3.2.0) | plg_editors_codemirror (3.15) | plg_editors_tinymce (4.0.10) | plg_user_joomla (3.0.0) | plg_user_contactcreator (3.0.0) | plg_user_profile (3.0.0) | plg_content_vote (3.0.0) | plg_content_finder (3.0.0) | plg_content_joomla (3.0.0) | plg_content_pagebreak (3.0.0) | plg_content_emailcloak (3.0.0) | plg_content_loadmodule (3.0.0) | plg_content_pagenavigation (3.0.0) | plg_system_languagefilter (3.0.0) | plg_system_log (3.0.0) | plg_system_logout (3.0.0) | plg_system_cache (3.0.0) | plg_system_sef (3.0.0) | plg_system_p3p (3.0.0) | plg_system_languagecode (3.0.0) | plg_system_remember (3.0.0) | plg_system_highlight (3.0.0) | plg_system_redirect (3.0.0) | plg_system_debug (3.0.0) |
Templates Discovered :: wrote:Templates :: SITE :: protostar (1.0) | beez3 (3.1.0) |
Templates :: ADMIN :: hathor (3.0.0) | isis (1.0) |
Last edited by YOLO on Thu Nov 21, 2013 7:23 pm, edited 1 time in total.

Corneliu
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 21, 2013 2:19 pm

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by Corneliu » Thu Nov 21, 2013 5:43 pm

I have the same problem too, after upgrading to 3.2.
Currently, what I am certain about is that the problem is temporarily gone (for a while) if I restart the Apache server. Also, giving the fact that the error occurs on a file that actually exists and has all the permissions, could point that the problem could be environmental somehow. Maybe a cache somewhere?

YOLO
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Nov 14, 2013 11:23 am

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by YOLO » Thu Nov 21, 2013 7:19 pm

I found the cause of problem. Somehow didn't think of this before.

I had Piwik 2 Beta installed on the same hosting account with Joomla! and it appears they are conflicting. It doesn't matter whether it's in same domain, subfolder, a subdomain or different domain - problem still exists. Disabling Piwik and then refreshing PHP fixes the problem. But now I can't use Piwik, unless I get a second hosting account :/

I'll write to Piwik forums. Maybe they have any clue how to make Piwik and J! friends again :)

vivizio
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Nov 25, 2013 4:10 am

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by vivizio » Mon Nov 25, 2013 4:13 am

Yes i have the same problem... Piwik causing the problem... But is it maybe about memory allocation problem? I can't figure it out how can be this two connected elsewhere? It just happens that after some 3-5 seconds it works again ...

RedEye
Joomla! Ace
Joomla! Ace
Posts: 1460
Joined: Sat Jan 21, 2006 8:42 pm

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by RedEye » Mon Nov 25, 2013 10:35 pm

With this error the reason is mostly because allow_url_fopen is disabled, does piwik change this var?

vivizio
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Nov 25, 2013 4:10 am

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by vivizio » Mon Nov 25, 2013 11:05 pm

No... But it uses a lot of checking of var allow_url_fopen and curl... Is possible that too much requests are opened at same time?

Corneliu
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 21, 2013 2:19 pm

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by Corneliu » Tue Nov 26, 2013 9:06 am

RedEye wrote:With this error the reason is mostly because allow_url_fopen is disabled, does piwik change this var?
I've checked with ini_get at runtime, it always show that allow_url_fopen is enabled, even when the error occurs.
(Note, I have the latest beta, Piwik 2.0-b9)

YOLO
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Nov 14, 2013 11:23 am

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by YOLO » Wed Nov 27, 2013 10:11 am

Seems like enabling allow_url_fopen in Piwik's directory fixed it for me. At least for now. Thanks.

YOLO
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Nov 14, 2013 11:23 am

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by YOLO » Wed Nov 27, 2013 10:24 am

Nope. The issue continues :/

vivizio
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Nov 25, 2013 4:10 am

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by vivizio » Wed Nov 27, 2013 10:07 pm

I tried a lot of things with different settings of apache and php ...

I think it must be something wrong with latest versions of php function simplexml_load_file ... or maybe it's wrapper inside for opening/reading files ....

Corneliu
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Nov 21, 2013 2:19 pm

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by Corneliu » Thu Nov 28, 2013 4:52 pm

I think I nailed it, I might need your help confirming it though.
It has to do with libxml_disable_entity_loader() function being called somewhere on the same host, and it will come to this PHP bug: https://bugs.php.net/bug.php?id=64938 (it seems to affect other PHP versions too, not just 5.4)

This function is being called in the piwik/core/FrontController.php , but also in some Symfony and Zend components.

I also called this function in joomla's index.php - libxml_disable_entity_loader(); - and I get the warning every time.
But if I provide a first parameter as boolean false, the entity loader is enabled again: libxml_disable_entity_loader(false)

So, if you have development installations on joomla, try adding libxml_disable_entity_loader(false); in joomla's index.php and see if the problem occurs again.

vivizio
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Nov 25, 2013 4:10 am

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by vivizio » Sun Dec 01, 2013 5:31 am

Confirmed, it works for me too. Thank you so much for sharing it !!

Armagetron
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Aug 26, 2014 12:04 pm

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by Armagetron » Thu May 28, 2015 10:47 am

Sorry for posting after such a long time. First of all, thanks for the fix. How do I make this permanent? When messing around with the index.php I have to reapply the change after each Joomla Update.

Is there a way to configure php properly so that this error does no longer occur?

SomoWeb
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu May 28, 2015 10:54 am
Contact:

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by SomoWeb » Thu May 28, 2015 11:06 am

I have the same problem too, after upgrading to 3.2.
Currently, what I am certain about is that the problem is temporarily gone (for a while) if I restart the Apache server. Also, giving the fact that the error occurs on a file that actually exists and has all the permissions, could point that the problem could be environmental somehow. Maybe a cache somewhere?


http://www.somoweb.com/

DarkFulgoreII
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jul 16, 2015 7:43 pm

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by DarkFulgoreII » Thu Jul 16, 2015 7:50 pm

Corneliu wrote:I think I nailed it, I might need your help confirming it though.
It has to do with libxml_disable_entity_loader() function being called somewhere on the same host, and it will come to this PHP bug: https://bugs.php.net/bug.php?id=64938 (it seems to affect other PHP versions too, not just 5.4)

This function is being called in the piwik/core/FrontController.php , but also in some Symfony and Zend components.

I also called this function in joomla's index.php - libxml_disable_entity_loader(); - and I get the warning every time.
But if I provide a first parameter as boolean false, the entity loader is enabled again: libxml_disable_entity_loader(false)

So, if you have development installations on joomla, try adding libxml_disable_entity_loader(false); in joomla's index.php and see if the problem occurs again.
I tried this with success! Thanks for the help.

I put this calling in the first line of the index.php on joomla and the problem dissapeared, but i found that 3 webapps in the same server disable the entity loader. i'm pretty concerned about the effect of this change. Probably, i'll have to check every app that uses the entity loader.

I guess there is a way to instanciate libxml individualy over each subdomain on my apache server. I'm finding out if this could be possible.

Thanks again, it was so useful !

connor0815
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Jan 08, 2016 4:11 pm

Re: J! 3.1.6/3.2 simplexml_load_file, JForm::getInstance err

Post by connor0815 » Fri Jan 08, 2016 5:18 pm

I'm also struggling with this error (0 JForm::getInstance could not load file) wich only sometimes occurs in the front & backend.
I'm using Jooma 3.4.5& php 5.3.28

Can someone please be so kind and tell me what exactly i've to write in my index.php?

Thank you....

Got, this one seems to fix it for me:

add:

libxml_disable_entity_loader(false);

in:

/libraries/joomla/language/language.php

before:

$xml = simplexml_load_file($path); (around line 1382)


Locked

Return to “Migrating and Upgrading to Joomla! 3.x”