Project

General

Profile

Actions

Bug #42412

closed

Failed opening required 'PATH_tslibclass.tslib_pibase.php'

Added by Bas van Beek over 11 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2012-10-26
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

While working in the TYPO3 backend we notice that the backend crashes after a while, when saving some content.

After investigating the Apache error log we see:

PHP Fatal error:  require() [<a href='function.require'>function.require</a>]: Failed opening required 'PATH_tslibclass.tslib_pibase.php' (include_path='/var/www/vhosts/bvbmedia.com/httpdocs/typo3/contrib/pear/:.:') in /repo/typo3_src-4.7.4/t3lib/class.t3lib_div.php on line 5063

We can bypass this problem by manually deleting the cache files:

rm typo3conf/temp_CACHED_* typo3temp/Cache/* -rf

This problem only occurs in TYPO3 4.7.X. When we downgrade the site back to 4.5.X LTS the problem dissapears.

Actions #1

Updated by Markus Klein over 11 years ago

Hi!

So you can permanently fix this issue by deleting the cache content in 4.7?

Actions #2

Updated by Benni Mack over 11 years ago

  • Status changed from New to Needs Feedback

Hey Bas,

can you also give more info about your installation? And your server environment (+ PHP modules etc). I'd be interested in seeing how I could reproduce this issue? Sounds very strange (and PHP-related).

Actions #3

Updated by Daniel Ostmann over 11 years ago

Hi,

ya, i can confrim this strange behaviour, in only one (!) of our TYPO3 projects. This happens from time to time and then have to delete the typo3temp/Cache/*

- TYPO3 4.7.4 (i think this happens since update to 4.7.0, maybe 4.6. as well, i barely can remember when i got this the first time)
- PHP 5.3.19
- Apache2
(it is a general account by Domain Factory, where we manage a lot of other TYPO3 projects)

Do you need some more infos about that TYPO3 installation?

Actions #4

Updated by Markus Klein over 11 years ago

Hi!

Does this also happen with the current version 4.7.7?

Looking at the exception again, "PATH_tslibclass.tslib_pibase.php" tells me that the constant PATH_tslib was not defined properly and PHP converted it to a string.
Since the constant is only defined in one single place, I fear there's some issue with the bootstrapping process.

Actions #5

Updated by Daniel Ostmann over 11 years ago

Now I did an update to 4.7.7 and got the exception again:

Fatal error: require() [function.require]: Failed opening required 'PATH_tslibclass.tslib_pibase.php'

Actions #6

Updated by Daniel Ostmann over 11 years ago

I've inserted

print_r(get_defined_constants(TRUE));
in class t3lib_div::requireFile(), (line 5060+) where i check if $requireFile does exist. The debug output tells that alle constants are defined as expected.

I don't think that this is a bootstrapping issue. I guess this happens when the cache files are gonna be rewritten to typo3temp/Cache/.

Full message on blank white screen is:

Fatal error: require() [function.require]: Failed opening required 'PATH_tslibclass.tslib_pibase.php' (include_path='/.../typo3/contrib/pear/:.:/usr/local/lib/php') in /.../typo3/t3lib/class.t3lib_div.php on line 5066

Actions #7

Updated by Markus Klein over 11 years ago

There's only one place where pi_base is loaded. Namely in the sysext/cms/ext_autoload.php file:

'tslib_pibase' => PATH_tslib . 'class.tslib_pibase.php',

t3lib_div::requireFile() is only used by the autoloader, which only makes a lookup into the table of autoloader registry generated from the ext_autoload.php files.

Hence the constant is not defined when the cms/ext_autoload.php file is parsed, which happens during bootstrap.

Could you please print a stacktrace in the ext_autoload.php file to see why the constants are not defined?

Actions #8

Updated by Daniel Ostmann over 11 years ago

I didn't get the error message since the last TYPO3 update anymore. So i can't give a stacktrace until the error occurs next time.

Maybe the update to 4.7.7 did fix it...

Actions #9

Updated by Daniel Ostmann over 11 years ago

The update did not fix it, the errors came back. I inserted a debug trace:

Message:

Fatal error: require() [function.require]: Failed opening required 'PATH_tslibclass.tslib_pibase.php' (include_path='/.../typo3/contrib/pear/:.:/usr/local/lib/php') in /.../t3lib/class.t3lib_div.php on line 5066

Backtrace:

#0  t3lib_div::requireFile(PATH_tslibclass.tslib_pibase.php) called at [/.../t3lib/class.t3lib_autoloader.php:97]
#1  t3lib_autoloader::autoload(tslib_pibase)
#2  spl_autoload_call(tslib_pibase) called at [/.../typo3conf/ext/pxf_gallery/class.tx_pxf_gallery_pi1.php:3]
#3  require_once(/.../typo3conf/ext/pxf_gallery/class.tx_pxf_gallery_pi1.php) called at [/.../typo3conf/temp_CACHED_ps486d_ext_tables.php:3601]
#4  include(/.../typo3conf/temp_CACHED_ps486d_ext_tables.php) called at [/.../typo3/init.php:381]
#5  require(/.../typo3/init.php) called at [/.../typo3/index.php:38]

The entry with "pxf_gallery" is a standard plugin which just extends the tslib_pibase class. There are a lot of such extensions extending tslib_pibase. I guess this one is the first to be loaded.

At #3 the temp cache file at line 3601 contains:

require_once(t3lib_extMgm::extPath('pxf_gallery').'class.tx_pxf_gallery_pi1.php');

At #1 i printed out the array $classNameToFileMapping of class t3lib_autoloader when the class should be autoloaded and not exists:

...
    [t3lib_utility_versionnumber] => /.../t3lib/utility/class.t3lib_utility_versionnumber.php
    [t3lib_xml] => /.../t3lib/class.t3lib_xml.php
    [tx_lang_clearcache] => /.../typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcache.php
    [tx_lang_clearcachemenu] => /.../typo3/sysext/lang/hooks/clearcache/class.tx_lang_clearcachemenu.php
    [tslib_adminpanel] => PATH_tslibclass.tslib_adminpanel.php
    [tslib_cobj] => PATH_tslibclass.tslib_content.php
    [tslib_frameset] => PATH_tslibclass.tslib_frameset.php
    [tslib_tableoffset] => PATH_tslibclass.tslib_tableoffset.php
    [tslib_controltable] => PATH_tslibclass.tslib_controltable.php
    [tslib_eidtools] => PATH_tslibclass.tslib_eidtools.php
    [tslib_fe] => PATH_tslibclass.tslib_fe.php
    [tslib_fecompression] => PATH_tslibclass.tslib_fecompression.php
    [tslib_fetce] => PATH_tslibclass.tslib_fetce.php
    [tslib_feuserauth] => PATH_tslibclass.tslib_feuserauth.php
    [tslib_gifbuilder] => PATH_tslibclass.tslib_gifbuilder.php
    [tslib_menu] => PATH_tslibclass.tslib_menu.php
    [tslib_tmenu] => PATH_tslibclass.tslib_menu.php
    [tslib_gmenu] => PATH_tslibclass.tslib_menu.php
    [tslib_imgmenu] => PATH_tslibclass.tslib_menu.php
    [tslib_jsmenu] => PATH_tslibclass.tslib_menu.php
    [tspagegen] => PATH_tslibclass.tslib_pagegen.php
    [fe_loaddbgroup] => PATH_tslibclass.tslib_pagegen.php
    [tslib_pibase] => PATH_tslibclass.tslib_pibase.php
    [tslib_search] => PATH_tslibclass.tslib_search.php
    [tslib_extdirecteid] => PATH_tslibclass.tslib_extdirecteid.php
    [sc_tslib_showpic] => PATH_tslibshowpic.php
...

Seems that only the constant PATH_tslib is not defined...

In folder /typo3/typo3temp/Cache/Code/cache_phpcode/ there are two cache files, i guess one for FE and one for BE autoloading. The first one contains correctly defined PATH_tslib the second one does not. Seems that it is only a backend issue...

That's for now, i have to clear the typo3temp/Cache because it is in productive mode...

Actions #10

Updated by Markus Klein over 11 years ago

From the stacktrace you can see that pibase is requested in the ext_tables.php file of the extension in line #3.
(the ext_tables.php is cached into temp_CACHED_ps486d_ext_tables.php:3601)

I don't know if it's a good idea to require a frontend plugin in the ext_tables.php file...

Please check if you installation works, once you disable pxf_gallery.

Actions #11

Updated by Daniel Ostmann over 11 years ago

Uuh, you are right. In the code jungle I didn't notice that. I removed the require() in that ext_tables.php.

Now I have to wait again...

Actions #12

Updated by Bas van Beek over 11 years ago

Tip works here too!

Had a bunch of plugins with require lines in ext_tables.php that loaded the PHP class.

We changed the hook values in ext_localconf.php by prefixing it with the PHP filename, so that TYPO3 is able to load the classes automatically.

Now no more crashes after working in the backend.

Thanks guys for tackling this annoying issue.

Actions #13

Updated by Daniel Ostmann over 11 years ago

Yep, seems to work now.

Thanx for your help, Markus.

Actions #14

Updated by Steffen Gebert over 11 years ago

  • Status changed from Needs Feedback to Closed
Actions

Also available in: Atom PDF