我能够安装Homestead并在虚拟机中创建一个新的应用程序。
但是,我确实有我在虚拟机外创建的应用程序,我想立即连接我的数据库。它可以在localhost / phpmyadmin下编辑,它是我在端口3306中的mysql标准安装。
我有来自互联网的文件夹,我指定的第一个应用程序叫做Laravel,我该怎么做?
如果我只是将它复制到同一目录中,我会得到:
php artisan serve
PHP Fatal error: Class 'Barryvdh\Debugbar\ServiceProvider' not found in /home/vagrant/Code/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
PHP Stack trace:
PHP 1. {main}() /home/vagrant/Code/foobooks/artisan:0
PHP 2. require_once() /home/vagrant/Code/foobooks/artisan:30
PHP 3. require() /home/vagrant/Code/foobooks/bootstrap/start.php:68
PHP 4. Illuminate\Foundation\ProviderRepository->load() /home/vagrant/Code/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() /home/vagrant/Code/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:57
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() /home/vagrant/Code/foobooks/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:121
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Barryvdh\\Debugbar\\ServiceProvider' not found","file":"\/home\/vagrant\/Code\/foobooks\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php","line":157}}vagrant@homestead:~/Code/foobooks$
vagrant@homestead:~/Code/foobooks$ cd laravel
-bash: cd: laravel: No such file or directory
答案 0 :(得分:2)
将数据库从主机移至宅基地:
artisan migrate
在家园中迁移数据库。您的家园数据库仍可通过主机127.0.0.1和端口33060(http://laravel.com/docs/4.2/homestead#daily-usage)
访问如果您在设置时遇到问题,这是一个很好的hometead 2.0教程:https://laracasts.com/lessons/say-hello-to-laravel-homestead-two