当我在服务器上运行应用程序时,没有问题。如何解决这个问题,为什么会出现这个问题? 编辑 -2016年5月28日-这是CartController:C:\xampp\php\php.exe -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=127.0.0.1 C:\Users\Nikolay\Dropbox\store\app\Http\Controllers\CartController.php PHP Fatal error: Class 'App\Http\Controllers\Controller' not found in C:\Users\Nikolay\Dropbox\store\app\Http\Controllers\CartController.php on line 14 PHP Stack trace: PHP 1. {main}() C:\Users\Nikolay\Dropbox\store\app\Http\Controllers\CartController.php:0
Fatal error: Class 'App\Http\Controllers\Controller' not found in C:\Users\Nikolay\Dropbox\store\app\Http\Controllers\CartController.php on line 14
Call Stack: 2.1491 376944 1. {main}() C:\Users\Nikolay\Dropbox\store\app\Http\Controllers\CartController.php:0
Process finished with exit code 255
<?php
namespace App\Http\Controllers;
use App\Cart;
use App\CartItem;
use App\Product;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
class CartController extends Controller
{
public function showCart() {...}
public function addItem(Request $request, $product_id) {...}
public function deleteItem($product_id, $size) {...}
public function showCheckout() {...}
private function calculateTotalPrice() {...}
}
C:\Users\Nikolay\Dropbox\store\app\Http\Controllers
目录下的Controller.php
文件是否存在?如果存在,那么请确认该类的命名空间是否为namespace App\Http\Controllers;
,并且类名是否为Controller
? - Luís Cruz/vendor/autoload.php
)。 - Luís Cruz