Laravel 5.6安装laracast/flash并更新nesbot/carbon后启动服务报错
Hey there, let's work through these two issues step by step!
server.php Not Found Error This error is stopping your local server from starting entirely, so let's tackle it first:
Check if
server.phpexists
Head over to your project root folderC:\xampp\htdocs\NC World\ProjectNameand make sure there's aserver.phpfile there. If it's missing, you can create one with the standard Laravelserver.phpcontent:<?php $uri = urldecode( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) ); // This file allows us to emulate Apache's "mod_rewrite" functionality from the // built-in PHP web server. This provides a convenient way to test a Laravel // application without having installed a "real" web server software here. if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { return false; } require_once __DIR__.'/public/index.php';Fix the space in your project path
Windows command line can struggle with paths that have spaces (likeNC World). Try moving your project to a path without spaces, for exampleC:\xampp\htdocs\NCWorld\ProjectName, then runphp artisan serveagain from the new location.Verify file permissions
Make sure your XAMPP Apache server has permission to read theserver.phpfile. Right-click the file → Properties → Security tab → Add "Authenticated Users" and grant them Read & Execute permissions.
The weird characters and squares during the Carbon download are almost always a terminal encoding problem:
Switch terminal to UTF-8
Open your command prompt and run this command before using Composer:chcp 65001This switches the terminal to use UTF-8 encoding, which should display the text correctly. Then re-run your Composer commands (like
composer update nesbot/carbon).Use Windows Terminal instead
The default Windows CMD has poor UTF-8 support. Switching to Windows Terminal (you can install it from the Microsoft Store) will handle UTF-8 characters out of the box, so you won't see garbled text anymore.Double-check Composer config
If the above don't work, you can add this to your project'scomposer.jsonto ensure smoother installs:"config": { "preferred-install": "dist", "platform-check": false }Then run
composer dump-autoloadto apply the changes.
内容的提问来源于stack exchange,提问作者Angnima Sherpa

