For example instead of getting the following
post:Array (
"a" => "b",
"c" => "d"
)
I just get this:
post:Array (\n "a" => "b",\n "c" => "d"\n)
It’s really uncomfortable to read this while debugging my code. So if you have any suggestion on why this couldn’t work alright, tell me.
I am running it in a Windows7 Putty connected to an Ubuntu virtual server, which runs supposedly it’s default Apache/PHP configuration. (well probably not, but as always nobody in the team remembers to have changed anything)
edit: Someone requested the code that writes to the error.log:
<?php
error_log(print_r(array("a"=>"b","c"=>"d"),1));
?>
The commands to view the error log are:
sudo tail -f /var/log/apache2/error.log
sudo vim /var/log/apache2/error.log
sudo cat /var/log/apache2/error.log
In all instances the problem occurs that \n is not executed as expected.
I also faced the same problem, but after spending a few minutes I got a solution.
When you do
tail, use as below:If you want, you can create a file. Give it some name and paste the above command and place that in the
/usr/bin/folder.For example
With the contents:
And put this in
/usr/bin/. Now you can usetailmeas a command.