1

when i execute $php spark serve, this show up

An uncaught Exception was encountered

Type: ErrorException Message: Required parameter $from follows optional parameter $verbs Filename: D:\XAMPP\htdocs\cites\vendor\codeigniter4\framework\system\Router\RouteCollection.p hp Line Number: 1017

fan
  • 21
  • 1
  • 2
  • 3
    You must have launched your spark serve from PHP8. Codeigniter is not yet fully compatible with PHP8 because of the deprecate of required parameters after optional parameters in function/method signatures – ViLar Dec 07 '20 at 13:12
  • You can try to install Codeigniter trough composer (which is available for windows too) and switch to the latest development build with the Codeigniter's builds script instead of using the current stable release, that is if you are "willing to live with the latest unreleased changes, which may be unstable" as stated in the Codeigniter docs. The development build seems to have support now for PHP 8. – Charlyboy Jan 22 '21 at 21:06
  • Does this answer your question? [Required parameter $xxx follows optional parameter $yyy](https://stackoverflow.com/questions/65297279/required-parameter-xxx-follows-optional-parameter-yyy) – miken32 Oct 16 '21 at 17:12

1 Answers1

0

Please go to system/Router/RouteCollection.php (line number as shown in error) and paste $from and $to before $verbs..it will solve your problem.. Cheers

Azzam
  • 1
  • 1