After updating my app from 3.9 to 4.1.4 shell scripts stopped working. Typing this bin/cake plugin assets symlink yields this error message:
PHP Fatal error: Uncaught Error: Class 'Cake\Routing\Router' not found in /var/www/releases/12/vendor/cakephp/cakephp/config/bootstrap.php:27
Stack trace:
#0 /var/www/releases/12/config/bootstrap.php(32): require()
#1 /var/www/releases/12/bin/cake.php(31): include('/var/www/...')
#2 {main}
thrown in /var/www/releases/12/vendor/cakephp/cakephp/config/bootstrap.php on line 27
I assume there is something wrong with autoloading, but I don`t know where to start with this.
It turns out I did not replace the contents of the bin folder. They have changed with the new major version of cakephp and must be replaced with the files from the app-skeleton: https://github.com/cakephp/app/tree/master/bin
Related
I have a shell located in PluginName/Console/Command/FooShell.php in CakePHP 2.6.3.
I've loaded this plugin via CakePlugin::load('PluginName'); in my app's bootstrap.php.
When that plugin is in ROOT/app_name/Plugin, and I run PluginName.foo, the shell works.
When that plugin is in ROOT/plugins and I run the same command, I get an error:
The command:
C:\xampp\htdocs\site_name\app_name>php Console/cake.php -app app_name PluginName.foo
The error:
Warning Error: include(C:\xampp\htdocs\site_name\app_name\Plugin\PluginName\Console\Command\FooShell.php): failed to open stream: No such file or directory in [C:\xampp\htdocs\site_name\lib\Cake\Core\App.php, line 547]
Warning Error: include(): Failed opening 'C:\xampp\htdocs\site_name\app_name\Plugin\PluginName\Console\Command\FooShell.php' for inclusion (include_path='C:\xampp\htdocs\site_name\lib;.;C:\xampp\php\PEAR') in [C:\xampp\htdocs\site_name\lib\Cake\Core\App.php, line 547]
Error: Shell class FooShell could not be found.
#0 C:\xampp\htdocs\site_name\lib\Cake\Console\ShellDispatcher.php(200): ShellDispatcher->_getShell('PluginName.back...')
#1 C:\xampp\htdocs\site_name\lib\Cake\Console\ShellDispatcher.php(66): ShellDispatcher->dispatch()
#2 C:\xampp\htdocs\site_name\app_name\Console\cake.php(33): ShellDispatcher::run(Array)
#3 {main}
For some reason, CakePHP is fine with this plugin being in ROOT/plugins when it's serving actual webpages, but throws an error in the console.
Nothing in the shell docs or the plugin docs explicitly says that there's anything different about using plugins in ROOT/plugins, but discussion of how that directory is used is conspicuously absent from the plugin and folder structure docs. (I assume because it's implied you're supposed to implement plugins the same way, regardless of which directory they're in.)
Am I doing this wrong?
when it is in the ROOT/plugins directory you need to load it like this in ROOT/lib/Cake/bootstrap.php
App::build(array('Plugin' => array(CAKE . DS . 'plugins' . DS)));
CakePlugin::load('<plugin-name>');
I have moved the CakePHP installation from my development server to production server (Config file and htaccess updated).
The production server was using an older version of PHP and I have requested the host to upgrade it. After they upgraded the PHP version, the site printing the php code on the webpage (Class : /lib/Cake/core/app) .. Also it displaying a fatal error on the bottom of the page, its below
Fatal error: Uncaught exception 'LogicException' with message 'Passed
array does not specify an existing static method (class 'App' not
found)' in /xxxxxxx/lib/Cake/bootstrap.php:154 Stack trace: #0
/xxxxxxx/lib/Cake/bootstrap.php(154): spl_autoload_register(Array) #1
/xxxxxxx/app/webroot/index.php(92): include('/xxxxxxx/pu...') #2
{main} thrown in /xxxxxxx/lib/Cake/bootstrap.php on line 154
Please help..
Have you checked the PHP version has actually changed, did you check (with phpinfo())?
Apparently, CakePHP was unable to find or load the App class (/xxxx/lib/Cake/core/App.php).
It's possible that paths have changed since the update, however, (if you're using CakePHP 2.3.1) line 134 of that same file uses this to load that file:
require CAKE . 'Core' . DS . 'App.php';
If the file was not present or could not be loaded, the script should stop at that point.
To check if your paths are correct, try to debug that path;
echo CAKE . 'Core' . DS . 'App.php'; die();
If that path is correct (my guess it is, otherwise the require should have stopped the script already as mentioned above), there is something wrong with the content of the App.php file. Maybe something corrupted the file (partial upload?) or incorrect line-endings caused PHP to interpret it incorrectly.
If the page is really showing the complete source of the App class, it may be possible you're (inadvertendly) using php 'short opening tags' and this has been disabled in the new configuration <? which may be cause, for example if a space is there is a space after the <? - <? PHP
More on short opening tags can be found here:
Are PHP short tags acceptable to use?
I have been having an issue that has been driving me nuts all day.
I have a cakePhp site working with no problems on my local machine, another developers local machine and a dedicated server (for the production environment). I copied the development installation to a shared host (justhost.com). When I copied the site over (using rsync) to the shared host, I receive the following error:
Fatal error: Uncaught exception 'MissingPluginException' with message 'Plugin TinyMce could not be found.' in /home4/ncreport/public_html/mars/lib/Cake/Core/CakePlugin.php:97 Stack trace: #0 /home4/ncreport/public_html/mars/app/Config/bootstrap.php(71): CakePlugin::load('TinyMce') #1 /home4/ncreport/public_html/mars/lib/Cake/Core/Configure.php(81): include('/home4/ncreport...') #2 /home4/ncreport/public_html/mars/lib/Cake/bootstrap.php(138): Configure::bootstrap(true) #3 /home4/ncreport/public_html/mars/app/webroot/index.php(77): include('/home4/ncreport...') #4 {main} thrown in /home4/ncreport/public_html/mars/lib/Cake/Core/CakePlugin.php on line 97
<
I have tried multiple things found in google searches to remedy the problem. No luck. I have tried to change the .htaccess file to add a rewrite base, tried to specify the fully qualified plugin path in the bootstrap file, tried to delete everything and reinstall the entire app, tried to change the document root to several different values, tried everything I could think of.... It appears to be an issue with the shared host, but I am unable to determine the cause.
Any suggestions or recommendations?
I figured it out -- it turns out that on the current installation the names for the plugins is case sensitive. The installation where this was copied from does not have case sensitivity.
Corrected the case on the load statement and everything worked well.
I installed Dotnetnuke 4.8 on my site. Then I downloaded upgrade package of 5.1 and upload all file as given http://www.dotnetnuke.com/Community/Wiki/tabid/1409/page/Upgrading-DotNetNuke/Default.aspx
But after upgrading I am getting following error:
**Server Error in '/dotnetnuke' Application.
--------------------------------------------------------------------------------
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'Framework' is not declared.
Source Error:
Line 49: ' dynamically create provider
Line 50: Private Shared Sub CreateProvider()
Line 51: objProvider = CType(Framework.Reflection.CreateObject("data", "DotNetNuke.Modules.Html", ""), DataProvider)
Line 52: End Sub
Line 53:
Source File: C:\inetpub\vhosts\IRFANHYDER.COM\httpdocs\dotnetnuke\App_Code\HTML\DataProvider.vb Line: 51
**
Any Idea? What I did wrong?
Upgrading DNN from that point to 5.1 is a big task and should be done is smaller steps
Try going from 4.8 to 04.09.05
Then to 5.1.1 (link below recommends going to 5.4.4)
See link below for a fuller guide:
REF: http://www.willstrohl.com/Blog/EntryId/102/Suggested-DotNetNuke-Site-Upgrade-Path-s
Every time I uninstall a DotNetNuke module and check the box to remove files, it completely kills my site.
I'm running IIS7 on the x86 Windows 7 beta, and have had this problem with both 4.8.4 and 4.9.2. When the error happens, if I replace all of the DLL files in the bin folder, the site comes back to life.
Does anyone know of a workaround for this?
The error I get is as follows...
Compiler Error Message: BC30002: Type 'IClientAPICallbackEventHandler' is not defined.
Source Error:
Line 41: ''' -----------------------------------------------------------------------------
Line 42: Partial Class DefaultPage
Line 43: Inherits DotNetNuke.Framework.CDefault : Implements IClientAPICallbackEventHandler
Line 44:
Line 45: #Region "Properties"
Source File: C:\inetpub\wwwroot\Default.aspx.vb Line: 43
EDIT:
The files that get removed from the /bin folder during the uninstall of a module are:
DotNetNuke.Services.Syndication.dll
DotNetNuke.WebControls.dll
DotNetNuke.WebUtility.dll
SharpZipLib.dll
I'm not directly referencing any of those files - so am guessing that it must be a bug of some sort in the uninstall process. These files get removed during the uninstall only if my "Copy Local" setting is "True" on my DotNetNuke.dll reference.
Are you maybe compiling against a different version of one of the DNN dlls, and have that reference set to Copy Local?