0
0

More than 1 year has passed since last update.

【PHP】「Parse error: syntax error, unexpected end of file, expecting "," or ";" in~」というエラー発生

Last updated at Posted at 2022-02-18

今回のコード

index.php
<?php
echo "処理のはじまり!\n\n"

どこにでもある文字を出力をするコードです

実行

console
$ php index.php

実行!!

console
Parse error: syntax error, unexpected end of file, expecting "," or ";" in ~~~

解析エラー:構文エラー、予期しないファイルの終わり、「、」または「;」が必要です

上記のようなエラーが発生しました。

解決方法

翻訳を見れば誰でも分かることですが、終わりの;が抜けているためのエラーなのでセミコロンを追加します。

index.php
<?php
echo "処理のはじまり!\n\n"; //追加

とてもシンプルなエラーですがたまにやってしまう、、、

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