|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76968 error_log does not nt show correct ouput
Submitted: 2018-10-04 05:38 UTC Modified: 2018-11-18 22:38 UTC
From: forum at sodcore dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 7.0.32 OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
49 - 39 = ?
Subscribe to this entry?

 [2018-10-04 05:38 UTC] forum at sodcore dot com
 When error_log is run it addes extra lines to a variable like #12#11#11
 Yet code runs correctly.

Test script:
require "../standard/functions.php";
$d = "";
$temp = "data;";
// Check to make sure we have correct request method post and that the token key fits
if ($_SERVER ["REQUEST_METHOD"] == "POST" && ! empty ( $_POST ["T"] ) && $_POST ["T"] == $TOKEN_LOCK_HTTP_POST)
	if (!empty($_POST["d"]))
		$d = $_POST["d"];
	// define variables and set to empty values
	$con = get_database_connection ();
	// If there is a result echo the results
	$sqlStatment = prepare_sql("select * from table,table2 WHERE =
		and table2.serial = '$d';");
	if ($res = $con->query($sqlStatment)) {
		$totalRows = $res->num_rows;
		// Return the total number of rows
		if ($totalRows > 0) {
			while ($row = $res->fetch_assoc()) {
				$temp .= $row['f'];
		$temp .= "-100";
	echo $temp;

Expected result:
 I expect error_log to log:
 select * from table,table2 WHERE =
		and table2.serial = '$d';
 But it logs:
 select * from table,table2 WHERE =
		and table2.serial = '$d';

 Yet the code works correctly.
 The logging is messed up in more then one of my files.

Actual result:
But it logs:
 select * from table,table2 WHERE =
		and table2.serial = '$d';


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-10-04 12:13 UTC] sjon at hortensius dot net
I cannot reproduce this. Do you have the same problem when you simply log the string directly? Maybe prepare_sql performs magic on it?
 [2018-10-04 12:16 UTC]
-Status: Open +Status: Feedback
 [2018-10-04 12:16 UTC]
It depends on what your prepare_sql() function would return, if it does any escaping or such, then it could be the reasoning for this behavior. Try var_dump($sqlStatement); before calling error_log() and see what it yields.

Seems more like an issue in your code, than a bug in error_log() itself
 [2018-10-04 12:16 UTC]
-Package: Apache2 related +Package: *General Issues
 [2018-11-18 22:38 UTC]
-Status: Feedback +Status: No Feedback
 [2018-11-18 22:38 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 17 10:01:28 2024 UTC