PHPackages                             jambagecom/fh-debug - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. jambagecom/fh-debug

ActiveTypo3-cms-extension[Debugging &amp; Profiling](/categories/debugging)

jambagecom/fh-debug
===================

PHP debugger, sys\_log and devLog Logger

v0.18.1(7mo ago)01.1kGPL-2.0-or-laterPHP

Since Sep 22Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/franzholz/fh_debug)[ Packagist](https://packagist.org/packages/jambagecom/fh-debug)[ Docs](https://jambage.com)[ RSS](/packages/jambagecom-fh-debug/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (1)Versions (35)Used By (0)

TYPO3 extension fh\_debug
=========================

[](#typo3-extension-fh_debug)

Installation Requirement
------------------------

[](#installation-requirement)

You must overwrite the TYPO3 Core file `sysext/core/Resources/PHP/GlobalDebugFunctions.php`of a classic installation or the `vendor/typo3/cms-core/Resources/PHP/GlobalDebugFunctions.php`of a Composer installation by the file `fh_debug/Patches/TYPO3/sysext/core/Resources/PHP/GlobalDebugFunctions.php`. Alternatively you can use "post-install-cmd" or "post-autoload-dump" and a file copy method in your composer.json. See [Defining scripts](https://getcomposer.org/doc/articles/scripts.md#defining-scripts) .

This will bring you back the former methods debugBegin and debugEnd into TYPO3 Core. This also contains the necessary PHP code to call fh\_debug if it is activated in the Extension Manager. Only by this file replacement fh\_debug will work at all.

What is does
------------

[](#what-is-does)

Use this extension to generate debug output files for the PHP code of TYPO3 and TYPO3 extensions in the Front End or Back End if they have PHP debug statements. Consider to also install **debug\_mysql\_db** if you want to debug the generated SQL queries or track down the PHP errors in the table **sys\_log** or the Developer traces written to the TYPO3 function **devLog**.

The debug output is written into a HTML debug output file. All the configuration is done in the Extension Manager for fh\_debug. You can design the output by the CSS file `fhdebug.css`. If you have a lot of debug output then you should put `debug (‘B’)` and `debug (‘E’)` PHP commands around the PHP debug commands in order to have fewer debug output lines in the file. These commands will activate and deactivate the debug output.

### force output

[](#force-output)

If a `debug (‘B’)` is required, but maybe not active, then you can use the third parameter `(group) ‘F’` to force an output. This is a special case to produce the output no matter if `debug (‘B’)` is set to be mandatory or not.

### example:

[](#example)

```
debug ('B');
$a = 'myString';
debug ($a, '$a at position 1');
debug ('E');
```

No debug output will be shown on the screen. Otherwise you must deactivate the debug output in the Install Tool.

```
$a = 'myString2';
debug ($a, '$a at position 1', 'F');
```

The debug output will always be shown.

News
----

[](#news)

Since version 0.15.0 the global error object is initialized automatically if it is not existent. This allows to insert debug calls almost everywhere in the TYPO3 backend even before the Middleware is dispatched.

Configuration
-------------

[](#configuration)

Just enter any invalid IP address:

> \[SYS\]\[devIPmask\] = 1.1.1.1

The Extension Manager configuration of fh\_debug will be added to the IP address of the Install Tool. `IPADDRESS = 34.22.11.12`. Your current IP address is shown in the Extension Manager view of fh\_debug below the field `IPADDRESS`. If your provides has an ip version 6 activated, then you must enter it in the IPv6 format.

### example:

[](#example-1)

> Enter your current IP address 11.12.13.14, if you want to debug this client’s actions.

### LocalConfiguration.php:

[](#localconfigurationphp)

Use the fh\_debug error handler in order to get debug messages of all exceptions. Add these lines into your file `LocalConfiguration.php`under typo3conf.

```
'SYS' => array(
   'displayErrors' => '2',
    'errorHandler' => 'JambageCom\\FhDebug\\Hooks\\ErrorHandler',
),
```

You can show more debug info and a backtrace with the TYPO3 error message **Oops, an error occurred!**. This is activated by default: `OOPS_AN_ERROR_OCCURRED = 1`. This will also add a detailed debug output to the debug file.

To get the debug output for “Oops, an error occurred!” you must make this configuration in the Install Tool or `LocalConfiguration.php`:

> \[SYS\]\[productionExceptionHandler\] =JambageCom\\FhDebug\\Hooks\\CoreProductionExceptionHandler

Remove this settings before you deinstall fh\_debug. Otherwise you will get this PHP error entry:

> PHP Fatal error: Uncaught Error: Class ‘JambageCom\\FhDebug\\Hooks\\CoreProductionExceptionHandler’ not found in /var/www/html/typo3\_src-9.5.8/typo3/sysext/core/Classes/Utility/GeneralUtility.php:3667

The default setting is:

> \[SYS\]\[productionExceptionHandler\] = TYPO3\\CMS\\Core\\Error\\ProductionExceptionHandler

### example:

[](#example-2)

```
if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('fh_debug')) {
    require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('fh_debug') . 'Classes/Utility/DebugFunctions.php');  // use t3lib_extMgm::extPath in TYPO3 4.5
    // some configuration:
    \JambageCom\Fhdebug\Utility\DebugFunctions::setErrorLogFile(''); // this is necessary if you use the error_log file
    // if you use the debug HTML file:
    \JambageCom\Fhdebug\Utility\DebugFunctions::setDebugFile('fileadmin/debug.html');

    \JambageCom\Fhdebug\Utility\DebugFunctions::setDebugBegin(FALSE);
    \JambageCom\Fhdebug\Utility\DebugFunctions::setRecursiveDepth('12');
    \JambageCom\Fhdebug\Utility\DebugFunctions::setTraceDepth('12');
    \JambageCom\Fhdebug\Utility\DebugFunctions::setAppendDepth('0');
    \JambageCom\Fhdebug\Utility\DebugFunctions::setTypo3Mode('ALL');
    \JambageCom\Fhdebug\Utility\DebugFunctions::setActive(TRUE);
    \JambageCom\Fhdebug\Utility\DebugFunctions::initFile();
}

\JambageCom\Fhdebug\Utility\DebugFunctions::debug ($_EXTCONF, '$_EXTCONF');
```

If you use the file **ext\_localconf.php** or some of the at first executed TYPO3 core files, then the extension fh\_debug has not been initialized yet. Therefore you must use the full namespace class to initialize and to call the class of fh\_debug.

> Class ‘JambageCom\\Fhdebug\\Utility\\DebugFunctions’ not found in /var/www/html/typo3\_src/typo3/sysext/core/Resources/PHP/GlobalDebugFunctions.php line 15

This means that your debug output shall be generated before the extension fh\_debug has been initialized by TYPO3. You must do your own initialization by these commands:

### example:

[](#example-3)

```
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('fh_debug') . 'Classes/Utility/DebugFunctions.php');
\JambageCom\Fhdebug\Utility\DebugFunctions::init();
\JambageCom\Fhdebug\Utility\DebugFunctions::setErrorLogFile('');
\JambageCom\Fhdebug\Utility\DebugFunctions::setDebugFile('fileadmin/debug.html');

debug ($tmp, 'variable before fh_debug has been started yet.');
```

debug begin and end
-------------------

[](#debug-begin-and-end)

There are 2 control commands available to begin and to end the generation of debug output: `debug (‘B’)` and `debug (‘E’)`.

### debug-begin and debug-end:

[](#debug-begin-and-debug-end)

### example:

[](#example-4)

```
debug ('B'); // begin debugging
debug ($myVariable, 'my variable');
debug ('E'); // end debugging
```

debug object with private members
---------------------------------

[](#debug-object-with-private-members)

Use the class `\JambageCom\FhDebug\Utility\DebugFunctions::getApi` method `object2array`to convert an object into an array. Then it will be possible to access the formerly private member variables. This is needed for large objects in order to generate less output.

```
// only for Debug START:
$debugApi = \JambageCom\FhDebug\Utility\DebugFunctions::getApi();
$queryArray = $debugApi->object2array($query);
debug ($queryArray['container'], '$queryArray[\'container\'] search Pos 1');
// only for Debug END:
```

Error
-----

[](#error)

If fh\_debug does not work, then there is probably the case where fh\_debug has not been activated yet. You can use PHP error logging as an alternative.

### example PHP error\_log :

[](#example-php-error_log-)

```
error_log('mymethod Position 2 $variableName: ' .  print_r($variableName, true) . PHP_EOL, 3, '/var/www/html/fileadmin/phpDebugErrorLog.txt');
error_log('printVariable $header: ' . $header . PHP_EOL, 3, \JambageCom\FhDebug\Utility\DebugFunctions::getErrorLogFilename());
error_log('printVariable $variable: ' . substr(json_encode($variable), 0, 120) . PHP_EOL, 3, \JambageCom\FhDebug\Utility\DebugFunctions::getErrorLogFilename());
```

Use you own path as the last parameter of the above method error\_log or use the method getErrorLogFilename to use the error filename set in the extension configuration. Use json\_encode to avoid a **PHP Fatal error: Allowed memory size of 268435456 bytes exhausted.** error.

Trouble shooting
----------------

[](#trouble-shooting)

If you do not get anything shown in the browser url , then make sure that this file debug.html really exists on the file system. If not, then create an empty file `debug.html` in the folder `fileadmin` and give Apache write access to it.

Check the configuration in the extension manager. IP addresses of the client browser Put in an asterisk \* . Then every client IP address will produce a debug output.

Improvements
------------

[](#improvements)

Please make an entry directly on the TYPO3 Core bug tracker at [add a control function for debugging](https://forge.typo3.org/issues/23899)[enhanced debug methods](https://forge.typo3.org/issues/86220)

Global functions can only be implemented in the TYPO3 core.

ToDO
----

[](#todo)

Program a TYPO3 patch extension which overwrites TYPO3 core files.

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance77

Regular maintenance activity

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~79 days

Recently: every ~144 days

Total

33

Last Release

236d ago

PHP version history (7 changes)v0.6.5PHP &gt;=5.5.0

v0.7.0PHP &gt;=7.0.0,&lt;=7.99

v0.8.2PHP &gt;=7.0.0,&lt;=7.4

v0.9.2PHP ^7.0

v0.9.3PHP ^7.2

v0.10.0PHP ^8.0

v0.10.1PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4c36ec751f4996bdd88bcfca2669db1d0762e765cb449b33d47aed99ef1e1b1c?d=identicon)[franzholz](/maintainers/franzholz)

---

Top Contributors

[![franzholz](https://avatars.githubusercontent.com/u/4855265?v=4)](https://github.com/franzholz "franzholz (222 commits)")

---

Tags

debugerrorTYPO3 CMSsyslogdevlogoops

### Embed Badge

![Health badge](/badges/jambagecom-fh-debug/health.svg)

```
[![Health](https://phpackages.com/badges/jambagecom-fh-debug/health.svg)](https://phpackages.com/packages/jambagecom-fh-debug)
```

###  Alternatives

[filp/whoops

php error handling for cool kids

13.2k402.4M1.4k](/packages/filp-whoops)[symfony/var-dumper

Provides mechanisms for walking through any arbitrary PHP variable

7.4k855.5M8.0k](/packages/symfony-var-dumper)[barryvdh/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k124.3M623](/packages/barryvdh-laravel-debugbar)[php-debugbar/php-debugbar

Debug bar in the browser for php application

4.4k21.3M40](/packages/php-debugbar-php-debugbar)[recca0120/laravel-tracy

A Laravel Package to integrate Nette Tracy Debugger

388283.0k3](/packages/recca0120-laravel-tracy)[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
