The ordered list tag should be outside the loop otherwise you’re making a new list every time you loop through
$x
This should work:
<?php
$x = 1;
echo "<ol>";
while($x <= 5) {
echo "<li>" + $x + "</li>";
$x++;
}
echo "</ol>";
?>