0
我想用PHP創建一個簡單的命令行應用程序,但我不斷收到:PHP致命錯誤:未捕獲的錯誤:類「的Symfony 分量控制檯應用程序」沒有找到
PHP Fatal error: Uncaught Error: Class 'Symfony\Component\Console\Application' not found in /Applications/MAMP/htdocs/newcli/dan.php:6
Stack trace:
#0 {main}
thrown in /Applications/MAMP/htdocs/newcli/dan.php on line 6
Fatal error: Uncaught Error: Class 'Symfony\Component\Console\Application' not found in /Applications/MAMP/htdocs/newcli/dan.php:6
Stack trace:
#0 {main}
thrown in /Applications/MAMP/htdocs/newcli/dan.php on line 6
我在做什麼錯?我的PHP版本:PHP 7.1.0RC6 (cli) (built: Nov 9 2016 04:45:59) (NTS)
dan.php:
#! usr/bin/env php
<?php use Symfony\Component\Console\Application;
require 'vendor/autoload.php';
$app = new Application('Task App', '1.0');
$app->add(new Acme\ShowCommand());
$app->run();
後,你確認控制檯組件安裝是否正確?從項目文件的直接位置得到'php composer.phar info'的輸出是什麼? – Vamsi