2
votes

I want to include PHP code in my TYPO3, I found php_page_content, I installed the extension that I found here . The installation went fine, no error, then I cleared my cache. After addind a PHP content in my page enter image description here

Then I got a fatal error saying :

PHP Fatal error: require_once(): Failed opening required '/var/www/clevvermail/typo3/sysext/cms/tslib/class.tslib_pibase.php' (include_path='/var/www/my_typo3/typo3/contrib/pear/:.:/usr/share/php') in /var/www/my_typo3/typo3conf/ext/page_php_content/pi1/class.tx_pagephpcontent_pi1.php on line 30

I checked and I found no class.tslib_pibase.php in my TYPO3!!! How can I manage this ?

enter image description here

PS: I tried to use the extension Page PHP Content Element but it didn't work for me, I install and I find no PHP script in the content list to include.

3

3 Answers

2
votes

You can find the solution here

In your class.tx_pagephpcontent_pi1.php on line 30

You can replace this

require_once(PATH_tslib . 'class.tslib_pibase.php');

By

if (!class_exists('tslib_pibase')) require_once(PATH_tslib . 'class.tslib_pibase.php');

This works for both Typo3 4.x and 6.2

0
votes

I think that the extension is outdated and no compatible with TYPO3 6.2. It gives no error just because in the file ext_emconf.php there is no constraint about the CMS version (!)

About the other extension you cited: I was able to make it work with these steps (TYPO3 6.2.30:

  1. Install Extension
  2. TS Setup > edit whole template record > include static from extension > include "Page PHP Content Element (pe_pagephpcontentelement)"

  3. Create a Sysfolder (like "phpscripts")

  4. go to "phpscripts" > list view > create new > "Page PHP Content Element > P H P Content"

  5. insert some code (like the one you provided) and save

  6. go to a page > create new content element > tab "Plugins > "General plugin"

  7. After you insert the element, edit it, tab "Plugin" > from the "selected plugin" dropdown, select "Page PHP content"

  8. Tab Behavior > Record storage page > select the sysfolder "phpscripts"

  9. Save and preview

I am sorry, but I was not able to figure out how to select a single record from the sysfolder :(

0
votes

You can install the extension migration_core or the extension compatibility6. migration_core contains a Migrations/Code/ folder with class alias mappers. Every reference to the class "tslib_pibase" will be automatically referred to "\TYPO3\CMS\Frontend\Plugin\AbstractPlugin::class". It is sufficient to have it installed. However compatibility6 is not recommended, because it also contains other changes which have drawbacks.

If you still have the same error message, then open the TYPO3 Install Tool first tab "Important actions".

Dump Autoload Information
[Create autoload information for extensions]

This (re-)dumps autoload information for all active third party extensions.