What error was encountered in the PHP script and how was it resolved?

The error encountered in the PHP script was a syntax error due to missing semicolons at the end of each line. This issue can be resolved by adding semicolons at the end of each line of code where it is missing.

// Incorrect code with missing semicolons
$variable1 = "Hello"
$variable2 = "World"

// Corrected code with semicolons added
$variable1 = "Hello";
$variable2 = "World";