Closed JasonTolliver closed 10 years ago
Well, I can't replicate this. What happens when you add @
in front of ob_end_clean()
in vendor/darsain/laravel-console/src/routes.php:15
?
}
@ob_end_clean();
Console::addProfile('error', array(
Still getting a parsing error, quite strange:
{"queries":[],"memory":3407872,"memory_peak":3407872,"time":0,"time_queries":0,"time_total":24,"output":"","output_size":0,"error":{"type":"E_PARSE","message":"syntax error, unexpected '\"', expecting T_STRING","file":"\/webroot\/practicegenius\/jtolliver\/laravel\/vendor\/darsain\/laravel-console\/src\/Darsain\/Console\/Console.php(111) : eval()'d code","line":1}}{"queries":[],"memory":3670016,"memory_peak":3670016,"time":0,"time_queries":0,"time_total":27,"output":"","output_size":0,"error":{"type":500,"message":"syntax error, unexpected '\"', expecting T_STRING","file":"\/webroot\/practicegenius\/jtolliver\/laravel\/vendor\/darsain\/laravel-console\/src\/Darsain\/Console\/Console.php(111) : eval()'d code","line":1}}
An interesting discovery... It seems that it has to do with strings. I killed the script directly after line 111 of vendor/darsain/laravel-console/src/Darsain/Console/Console.php
and got this:
btw I'm using MAMP, php 5.3.14, on osx Mavericks
I'm looking around, it might be something in my configuration
Indeed I was able to recreate the same error by simply running this php file in the command line:
<?php
eval('echo \"dad\";');
Has to do with the single quotes that surround the string within eval
. If they're double quotes, no trouble at all... Not sure what exactly it is about my setup that gives me such a ridiculously strict sort of error, my error reporting in php.ini is set to E_ALL so shouldn't be giving issues.. Oh well, I can probably hack something together to make it all work
Got it! It was magic_quotes :P
Gotta have that turned off. Not sure if you want a quick runtime check for that somewhere, might ale troubleshooting easier for anybody running < 5.4, though at this point it may just be a waste of time.
Thanks for your time!
Ok, I just want to make sure that prepending the error suppression sign @
fixed the error reporting, meaning that console started showing you that nice graphical error description (red rectangle with line number and error message) instead of that malformed JSON string.
Or did you made any other tweaks?
It did not, only when I killed it manually after the actual eval()
on line 111 did it display it nicely.
How did you "killed it manually"?
I am also facing the problem. I am using Laravel 4.1.
Line 1 syntax error, unexpected '"', expecting T_STRING Execution failed: 500 Internal Server Error
@ankur0101 have you tried turning off magic_quotes? As suggested in comment above?
Not sure if I'm doing something wrong here, but even on the simplest of code it gives me output errors and tells me my code ended unexpectedly.