You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法通过Cmd+Click访问Laravel开发服务器,启动后无窗口显示求助

Troubleshooting Laravel Serve Cmd+Click Issue on Mac

Hey there! Let's work through this problem together—since your php artisan serve command is successfully starting the server without errors, the issue is probably not with Laravel itself, but with how your system or VS Code is handling the link. Here are some practical steps to fix it:

  • Try manual access first: Copy the http://127.0.0.1:8000 URL from your terminal and paste it directly into your default browser (Safari, Chrome, etc.). If the Laravel welcome page loads, that confirms the server is running perfectly, and the problem is just with VS Code's link-clicking functionality.

  • Fix VS Code's external link handler:
    Open VS Code settings (press Cmd+, on Mac), search for Terminal > External: Osx Exec, and make sure it's set to launch your preferred browser. For example:

    • For Chrome: open -a "Google Chrome"
    • For Safari: open -a "Safari"
      Sometimes VS Code defaults to a different app that isn't opening correctly, so this should fix the Cmd+Click issue.
  • Switch to a different port:
    Run php artisan serve --port=8080 to start the server on port 8080 instead of 8000. Then try both Cmd+Clicking the new http://127.0.0.1:8080 link and manually opening it. If this works, port 8000 might be occupied by another process. You can check what's using port 8000 with this command:

    lsof -i :8000
    

    Kill the conflicting process if needed (use kill -9 [PID] where [PID] is the process ID from the output).

  • Check directory permissions:
    If even manual access doesn't work, ensure your Laravel project has the right permissions for critical folders. Run these commands from your project root:

    chmod -R 755 storage bootstrap/cache
    

    These directories need write access for Laravel to store logs and cache files, which can cause silent failures if permissions are misconfigured.

  • Verify PHP version compatibility:
    Make sure your installed PHP version matches the requirements of your Laravel version. Run php -v to check your PHP version, and confirm it meets the minimum requirement for your Laravel release (e.g., Laravel 10 needs PHP 8.1 or higher). A version mismatch can cause unexpected behavior even if the server starts.

If none of these steps work, let me know what happens when you try manual access (does the browser show an error?) or share any messages from your browser's developer console—those details can help narrow it down further!

内容的提问来源于stack exchange,提问作者katies1987

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 07:53:13