LoginSignup
0
0

More than 1 year has passed since last update.

2022-06-24 PHP のコマンドラインアプリケーションにおいて、エラーが表示されない

Posted at

環境

  • CentOS 7
  • PHP 5.4

発生した問題

PHP のコマンドラインアプリケーションにおいて、エラーが表示されない

$ php ./script.php
$ echo $?
255

exit code 255 は多くの場合、エラーが発生していることを示す。

解決方法

コード内で以下を指定する。

error_reporting(E_ALL)
ini_set('display_errors', 'on')
ini_set('log_errors', 'on')

解説

確認する箇所は以下の三点

  1. "error_reporting" の値が "E_ALL" か
  2. "display_errors" の値が "on" か
  3. "log_errors" の値が "on" か
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0