Zum Inhalt springen

Log PHP errors in a file

Furnishings

With settings in the php.ini file or in the TYPO3 install tool, you can define how errors are handled in PHP.

In the standard configuration of the php.ini file, the error messages are displayed in the browser. With a setting in the php.ini configuration, these can also be written to a log file. Individual php.ini settings can be made for each domain. These are made in the customer menu via the menu item

Configuration ' Domain management ' Gears ' Open ' Settings ' PHP.INI editor

Please note: The log file can reach a considerable size over time and should therefore be deleted from time to time.

Under Use global PHP.INI settings, change the entry from Yes (global) to NO (domain-specific)

activate

  • allow_url_fopen
  • log_errors

deactivate

  • display_errors
  • register_globals
  • magic_quotes_gpc

set the value of upload_max_filesize to 128M

The following parameters still need to be adjusted or added under Other settings:

  1. memory_limit = "256M"
  2. post_max_size = "128M"
  3. error_log = "/www/123467_98765/rp-hosting/1234/5678/php-error.log"

Please note that the value given here serves as an example and must be replaced with the corresponding values. You can find the complete server path under the menu item General ' Information

Evaluation

New warning or error messages are always written to the end of the file. The last lines can be output via the shell access with the following command:

tail -f php-error.logNew

messages appear automatically in the terminal window until the output is stopped with CRTL-C.

Updated: 17.07.2024