2017-01-05 48 views
1

我試圖我的CakePHP 2應用程序升級到CakePHP的3升級CakePHP的2個應用程序 - > CakePHP的3應用程序,`無法聲明應用程序,因爲名稱已經在use`

我使用PHP的時候有一個問題, 7.1 & Ubuntu的16 nginx的和/ 1.10.0(Ubuntu的)

我收到以下錯誤......

Fatal error: Cannot declare class lib\Cake\Core\App because the name is already in use in /usr/share/nginx/html/web/lib/Cake/Core/App.php on line 70 

我下面這個頁面:https://github.com/cakephp/upgrade

我第一次使用這些命令:

bin/cake upgrade locations [path] 
bin/cake upgrade namespaces [path] 
bin/cake upgrade app_uses [path] 

bin/cake upgrade rename_classes [path] 
bin/cake upgrade rename_collections [path] 
bin/cake upgrade method_names [path] 
bin/cake upgrade method_signatures [path] 
bin/cake upgrade fixtures [path] 
bin/cake upgrade tests [path] 
bin/cake upgrade i18n [path] 
bin/cake upgrade skeleton [path] 
bin/cake upgrade prefixed_templates [path] 

更多的細節:

我的PHP版本(的php -v輸出):

PHP 7.1.0-5+deb.sury.org~xenial+1 (cli) (NTS) 
Copyright (c) 1997-2016 The PHP Group 
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies 
    with Zend OPcache v7.1.0-5+deb.sury.org~xenial+1, Copyright (c) 1999-2016, by Zend Technologies 
    with Xdebug v2.5.0, Copyright (c) 2002-2016, by Derick Rethans 

和我的Ubuntu版本(的lsb_release -a輸出)是:

No LSB modules are available. 
Distributor ID: Ubuntu 
Description: Ubuntu 16.04.1 LTS 
Release: 16.04 
Codename: xenial 

回答

0

看起來你可能會喜歡在include_path上使用CakePHP,或者以升級插件內部不是composer install的方式安裝升級插件。除非您已將升級工具克隆到/usr/share/nginx/html/web/

+0

升級插件位於/ usr/share/nginx/html/upgrade中,我在/ bin中安裝了composer.phar,並使用它來安裝升級工具,位於/ usr/share/nginx/html /升級,我跑了所有的 'bin/cake升級[填空] ../ web' 命令 – user904542

+0

我確實有舊的cakephp 2版本的我的應用程序的備份 – user904542

+0

那麼我用get_include_path來查找我的php包含路徑,並在/ usr/share/path中找到它,然後在ls那裏找到並發現: 7.0 7.1歸檔Cake Console數據文檔OS PEAR pearcmd.php PEAR.php peclcmd.php PHP結構System.php運行'sudo find -name Cake'的XML 那個文件夾給了我這個: ./Cake ./data/CakePHP/Cake – user904542

相關問題