类名冲突

反馈 clwm01 • at 2016-09-21 11:33:34 • by strwei at 2017-02-21 22:17:01 • 696 Views

如题,安装的过程中,执行php artisan hifone:install,然后就出现下面的问题

PHP Fatal error:  Cannot declare class CreateThreadsTable, because the name is already in use in /Users/rextsao/Documents/Workspace/GitHub/Hifone/database/migrations/2016_05_29_013243_create_threads_table.php on line 66
PHP Stack trace:
PHP   1. {main}() /Users/rextsao/Documents/Workspace/GitHub/Hifone/artisan:0
PHP   2. Illuminate\Foundation\Console\Kernel->handle() /Users/rextsao/Documents/Workspace/GitHub/Hifone/artisan:35
PHP   3. Symfony\Component\Console\Application->run() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107
PHP   4. Symfony\Component\Console\Application->doRun() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/symfony/console/Application.php:117
PHP   5. Symfony\Component\Console\Application->doRunCommand() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/symfony/console/Application.php:186
PHP   6. Illuminate\Console\Command->run() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/symfony/console/Application.php:794
PHP   7. Symfony\Component\Console\Command\Command->run() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
PHP   8. Illuminate\Console\Command->execute() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/symfony/console/Command/Command.php:256
PHP   9. Illuminate\Container\Container->call() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
PHP  10. call_user_func_array:{/Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:1257}() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:1257
PHP  11. Hifone\Console\Commands\InstallCommand->handle() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:1257
PHP  12. Illuminate\Events\Dispatcher->fire() /Users/rextsao/Documents/Workspace/GitHub/Hifone/app/Console/Commands/InstallCommand.php:66
PHP  13. call_user_func_array:{/Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:10124}() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:10124
PHP  14. Illuminate\Events\Dispatcher->Illuminate\Events\{closure}() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:10124
PHP  15. call_user_func_array:{/Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:10179}() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:10179
PHP  16. Hifone\Console\Commands\Subscribers\CommandSubscriber->onRunMigrations() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:10179
PHP  17. Illuminate\Console\Command->call() /Users/rextsao/Documents/Workspace/GitHub/Hifone/app/Console/Commands/Subscribers/CommandSubscriber.php:152
PHP  18. Illuminate\Console\Command->run() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Console/Command.php:185
PHP  19. Symfony\Component\Console\Command\Command->run() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
PHP  20. Illuminate\Console\Command->execute() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/symfony/console/Command/Command.php:256
PHP  21. Illuminate\Container\Container->call() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
PHP  22. call_user_func_array:{/Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:1257}() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:1257
PHP  23. Illuminate\Database\Console\Migrations\MigrateCommand->fire() /Users/rextsao/Documents/Workspace/GitHub/Hifone/bootstrap/cache/compiled.php:1257
PHP  24. Illuminate\Database\Migrations\Migrator->run() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:76
PHP  25. Illuminate\Database\Migrations\Migrator->requireFiles() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:84
PHP  26. Illuminate\Filesystem\Filesystem->requireOnce() /Users/rextsao/Documents/Workspace/GitHub/Hifone/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:282
  [Symfony\Component\Debug\Exception\FatalErrorException]                      
  Cannot declare class CreateThreadsTable, because the name is already in use

请问怎么解决?

Total: 3
  • Hifone 2016-09-21 14:38:24

    是最新版本么?

  • clwm01 2016-09-21 18:11:01

    @Hifone 您好,已经解决了,可能是因为没有找到mysqldump,然后程序就中断了,但是migrations文件已经生成了,所以再次执行php artisan hifone:install就会出现那个问题。

    我把migrations文件夹清空后,重新执行php artisan hifone:install就可以了。

  • strwei 2017-02-21 22:17:01

    谢谢,我也正在处理这个问题谢谢,我也正在处理这个问题 @clwm01

Add a reply
For Commenting you need to Login. If you dont have a Account you need to Register.