Skip to content

Blank lines in the PHP error log #605

@hackwin

Description

@hackwin

Describe the bug
The PHP error log should have two types of lines: error/exception and stack trace. No blank lines.

Used config
Apache and PHP 8

Code to Reproduce
The troubling section which demonstrates the reported bug: After line, #3 {main} there's a blank line.

[08-Oct-2025 13:17:42 America/New_York] PHP Fatal error:  Uncaught Webklex\PHPIMAP\Exceptions\ConnectionFailedException: No connection could be made because the target machine actively refused it in C:\wamp64\www\example.com\tests\purelymail-api\php-imap\src\Connection\Protocols\Protocol.php:250
Stack trace:
#0 C:\wamp64\www\example.com\tests\purelymail-api\php-imap\src\Connection\Protocols\ImapProtocol.php(84): Webklex\PHPIMAP\Connection\Protocols\Protocol->createStream('ssl', 'localhost', 993, 30)
#1 C:\wamp64\www\example.com\tests\purelymail-api\php-imap\src\Client.php(471): Webklex\PHPIMAP\Connection\Protocols\ImapProtocol->connect('localhost', 993)
#2 C:\wamp64\www\example.com\tests\purelymail-api\php-imap-test.php(14): Webklex\PHPIMAP\Client->connect()
#3 {main}

Next Webklex\PHPIMAP\Exceptions\ConnectionFailedException: connection failed in C:\wamp64\www\example.com\tests\purelymail-api\php-imap\src\Connection\Protocols\ImapProtocol.php:92
Stack trace:
#0 C:\wamp64\www\example.com\tests\purelymail-api\php-imap\src\Client.php(471): Webklex\PHPIMAP\Connection\Protocols\ImapProtocol->connect('localhost', 993)
#1 C:\wamp64\www\example.com\tests\purelymail-api\php-imap-test.php(14): Webklex\PHPIMAP\Client->connect()
#2 {main}
  thrown in C:\wamp64\www\example.com\tests\purelymail-api\php-imap\src\Connection\Protocols\ImapProtocol.php on line 92

Expected behavior
No blank lines should appear in the error log file. It should be either the error/exception or the stack trace.

Screenshots
See above.

Desktop / Server (please complete the following information):

  • OS: Windows 11
  • PHP: 8
  • Version: most recent version as of October 8, 2025
  • Provider [e.g. Gmail, Outlook, Dovecot]

Additional context
The purpose for this bug report is to get a clean logs that can be loaded into a database table with the log file line number of the error, and appending the stack trace to the row. A database table of PHP errors can be queried to find patterns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions