whoami
Lucas Jenß
cat /etc/motd
The Coding Journal ツ — Notes taken on an epic coding journey. Technical solutions, debugging notes, and practical guides from the trenches of software development.
ls -la ~/languages/
- drwxr-xr-x
- ▶ PHP
- ▶ Ruby
- ▶ Scala
- ▶ C#
- ▶ JavaScript
- ▶ Objective-C
- ▶ Shell Scripting
ls -la ~/toolchain/
- drwxr-xr-x
- ▶ Typo3
- ▶ Akka
- ▶ Capistrano
- ▶ Git
- ▶ MAMP
- ▶ Adobe Illustrator
- ▶ NSTrackingArea (Cocoa)
uname -a
- drwxr-xr-x
- ▶ Mac OS X
- ▶ Unix
Diagnosing TYPO3 Backend PHP Timeouts
A PHP script that stops during TYPO3 backend processing can appear to fail without warning. An editor may see a blank page, a gateway error, or a message stating that the maximum execution time has been exceeded. In other cases, the backend request keeps spinning while PHP-FPM, Apache, or Nginx waits for a long-running operation to finish.
The visible error is often only the final symptom. Imports, database queries, image transformations, cache rebuilding, workspace publishing, and extension tasks can all consume more time than a normal browser request allows. The reliable fix comes from identifying which limit was reached and then reducing or relocating the expensive work.
| Symptom | Likely cause | First diagnostic step | Suitable remedy |
|---|---|---|---|
| Fatal execution-time error | PHP max_execution_time reached |
Check the PHP and TYPO3 logs | Raise the limit temporarily or split the task |
| 504 Gateway Timeout | Web server or proxy stopped waiting | Compare Nginx, Apache, and PHP-FPM timeouts | Align upstream timeout values |
| Browser hangs, no PHP error | Slow query, lock, or memory pressure | Inspect database activity and server metrics | Optimise SQL, indexes, or resource usage |
| Import fails at a consistent point | Large record, file, or extension hook | Log progress for each batch | Process smaller batches through a queue |
| Backend works in CLI but not browser | Different PHP configuration or request limits | Compare phpinfo() and php -i |
Use a scheduler or command-line command |
Find The Exact Timeout Layer
Start by recording the operation, the user account, the backend module, and the approximate failure time. A timeout from the browser does not prove that PHP reached its execution limit. The request may have been terminated earlier by a reverse proxy, load balancer, web server, or hosting platform.
Review the TYPO3 system log, PHP error log, PHP-FPM pool log, and web server log together. Timestamps are especially useful when the application is hosted in Sydney but the server logs use UTC. A 504 response from Nginx usually points towards fastcgi_read_timeout or an upstream failure, while a PHP fatal error mentioning maximum execution time identifies a different boundary.
Keep a troubleshooting diary with the relevant command, configuration change, and observed result. Notes on Coding Journal provide a useful model for treating a recurring development fault as a reproducible investigation rather than a one-off guess.
Reproduce The Task Safely
Avoid testing a heavy import or cache rebuild directly on a busy production installation. First copy the database and required files to a staging environment, then remove or anonymise sensitive customer data. A failed backend request can leave partially imported records, temporary files, or an incomplete reference index.
Create a small test case that triggers the same code path. For an import, run ten or fifty records rather than the full catalogue. For image processing, use one representative large file. For a workspace publication, test a small change set. This makes each attempt fast enough to compare and reduces the chance of locking editors out of the backend.
Record the PHP version, TYPO3 version, installed extensions, database engine, and server arrangement. A script that completes under PHP 8.2 may behave differently under another version because of extension changes, query plans, or stricter error handling. Reproduction also exposes whether the problem belongs to TYPO3 core, a third-party extension, or project-specific code.
Separate Web And Command-Line Settings
A common source of confusion is assuming that the PHP configuration used by the shell is the same as the one used by the backend. php -i reports the CLI configuration, while a web request may use a separate php.ini, PHP-FPM pool, container image, or hosting profile. Check the web environment with a temporary protected diagnostic endpoint, and remove it immediately after use.
Important values include max_execution_time, memory_limit, max_input_time, post_max_size, and upload_max_filesize. A large upload can fail before the TYPO3 controller begins, whereas a slow transformation may exceed the execution limit after the upload has succeeded. Raising memory_limit will not fix a database lock, and increasing the web server timeout will not cure an inefficient loop.
A higher limit is useful for confirming the diagnosis, not necessarily as the final solution. If a task needs twelve minutes in a browser, it remains fragile even when the request is allowed to run for fifteen. Backend workers, TYPO3 scheduler tasks, or a dedicated CLI command are better places for work that has no reason to wait for an editor’s browser connection.
Inspect Database And Extension Behaviour
Long-running PHP often spends most of its time waiting for the database. Look for repeated queries inside loops, missing indexes on filtering columns, large joins, and queries that sort unbounded result sets. Enable appropriate database logging in a controlled environment and use EXPLAIN to examine slow statements rather than guessing from the PHP source.
TYPO3 extensions may add hooks to record saving, cache clearing, indexing, or file handling. A single backend action can therefore trigger several layers of custom code. Temporarily disable a suspected extension on staging, or add timing logs around its hooks. If the timeout disappears, inspect its configuration and update it before changing global PHP settings.
Database locks deserve special attention when an import runs alongside editorial work. A transaction waiting for another process can look like an application timeout. Check active connections, lock waits, and long-running transactions during the failure window. On a busy Australian retail site preparing for an end-of-financial-year promotion, scheduling bulk work outside editorial peaks can prevent this type of contention.
Add Progress Logging And Memory Checks
A script should reveal where it is spending time. Add structured log messages before and after each batch, including the record range, elapsed seconds, current memory usage, and exception details. Avoid logging complete customer records or uploaded content, particularly when the system contains personal information covered by Australian privacy obligations.
Batching is usually safer than allowing one request to process every item. Fetch a limited number of records, commit the result, release unused objects, and continue from a saved offset or identifier. An identifier-based cursor is often safer than a large offset because inserted or changed rows can make offset pagination skip records.
Monitor memory as well as elapsed time. PHP can hit memory_limit before max_execution_time, especially when an extension loads full image files or builds large arrays. Unset temporary objects, stream files where possible, and avoid repeatedly converting the same image. A script that becomes slower in later batches may be suffering from memory growth, garbage collection, or an increasingly large in-memory collection.
Move Heavy Work Into A Queue
Browser requests are designed for interactive feedback, not lengthy maintenance jobs. Use the TYPO3 scheduler or a command-line process for imports, indexing, cache warm-up, report generation, and image conversion. The backend can create a job and display its status while a worker performs the actual work independently.
A queue also makes retries and failure recovery clearer. Store the last successful record, mark failed items for review, and make each operation idempotent so that running it twice does not create duplicate records. Limit worker concurrency when the database or file system is modest. This is particularly important on shared hosting or smaller VPS plans used by local organisations.
For a distributed deployment, confirm that the worker sees the same files, environment variables, and database as the web node. A Sydney web server and a Perth worker may introduce unnecessary file transfer delays if uploads are stored locally rather than in shared object storage. Time zones should be explicit too: schedule jobs in UTC or clearly document AEST, AEDT, and local daylight-saving behaviour.
Tune Infrastructure After The Code
Once the application path is understood, align the surrounding limits. Nginx fastcgi_read_timeout, Apache proxy settings, PHP-FPM request termination values, load-balancer idle timeouts, and platform limits should accommodate the expected duration without masking runaway processes. Change one setting at a time and document its original value.
Check CPU, RAM, disk space, I/O wait, and database capacity during a test run. A server with sufficient memory can still time out if storage is saturated by simultaneous backups, image processing, or log rotation. Australian sites hosted in Sydney or Melbourne may have good local latency but still experience slow external API calls to overseas services, so measure network dependencies separately from local PHP execution.
Keep production limits conservative enough to protect the service. A request that occupies a PHP-FPM worker for ten minutes can reduce capacity for every editor and customer. A short web request that dispatches a durable background job gives faster feedback and makes resource usage easier to control than simply increasing every timeout value.
Document The Permanent Fix
After the script completes reliably, write down the root cause, affected versions, configuration changes, test data size, and rollback procedure. Include the command used to run the job and the location of its logs. This record helps future developers distinguish a known operational constraint from a newly introduced regression.
Add a test for the failure mode where practical. It might verify that an import processes records in batches, that a scheduler task can resume after an exception, or that a query uses the expected index. Monitor task duration and failure counts so that a gradual increase in catalogue size does not become a surprise backend outage.
For TYPO3 projects serving Australian businesses, review the process before seasonal traffic, a major catalogue upload, or a financial-year changeover. Apply the fix on staging, run a representative workload, then deploy during a quiet maintenance window. Trace the next timeout from the browser through the web server, PHP, TYPO3, extensions, database, and external services, and record the evidence before changing another limit.
cat ~/interests.json
| Key | Value |
|---|---|
| editor | Terminal-first workflow |
| os | Mac OS X / Unix |
| vcs | Git, distributed version control |
| deploy | Capistrano, cron automation |
| graphics | SVG, Adobe Illustrator troubleshooting |
| networking | IP validation, SSH, VPN |
git log --oneline --reverse
Solving SVG import issues in Adobe Illustrator CS6 and CC
When importing an SVG into Illustrator, the operation fails with an unknown error [CANT]. A workaround for this Adobe-side bug.
Solving NDK build issues on OS X
Troubleshooting native development kit compilation problems on Mac OS X.
Programmatically adding PHP generated TypoScript to the backend configuration
Integrating dynamically generated TypoScript into Typo3 backend setups using PHP.
ArgumentError: Could not parse PKey: no start line
Debugging an SSH key parsing error encountered during deployment.
Validating IP-Addresses in PHP
Using PHP filter functions with flags like FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6, and understanding how filter_var handles reserved IP addresses.
Cocoa: Using NSTrackingArea
A short tutorial on using Cocoa's NSTrackingArea to capture mouseEntered and mouseExited events.
cat ~/contact.txt