LoginSignup
1
0

More than 1 year has passed since last update.

php.iniを使ってエラー表示方法

Posted at

php.iniはphpのファイル設定のことを指す。

エラーの表示方法はphpのファイルのデフォルト設定では
デフォルトの設定では「display_errors = Off」となっています。
こちらの記述を編集します。

これを、
「display_errors = On」
にします、

場所は「Applicants > MAMP > bin > php > php7.3.8 > conf」
の順に移動していきます。

ファイル内検索で、「display_errors」を検索すれば、手間が省けます。

デフォルトでは「display_errors = Off」となっているので、
 
設定を「On」に編集してファイルを保存します。

それも表示がうまくいかない場合は、PHPファイルに直接記述していきましょう。

//エラー表示
<?php

ini_set('display_errors', 1);

?>

//エラーしない
<?php

ini_set('display_errors', 2);

?>

となります。

1
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
1
0