Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress PHP Errors' HTML tags when running from CLI [duplicate]

When I run php -l someFile on the CLI, the output is marked up with HTML tags:

$ php -l someFile.php 
<br />
<b>Parse error</b>:  syntax error, unexpected T_ECHO in <b>/home/someUser/public_html/someFile.php</b> on line <b>42</b><br />
Errors parsing someFile.php
$

How can I suppress these HTML tags? I am actually using a custom php.ini for the parsing (not shown in example to simplify), so if a php.ini modification will solve the issue then that is fine.

Thank you.

like image 232
dotancohen Avatar asked Mar 07 '26 11:03

dotancohen


1 Answers

Set html_errors to false in your ini file http://php.net/manual/en/errorfunc.configuration.php#ini.html-errors

$ php -dhtml_errors=0 -l someFile
like image 136
Mike B Avatar answered Mar 10 '26 02:03

Mike B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!