cakephp 2.1 migration cache error - cakephp

I'm trying to migrate my app from cakephp 2.0 to 2.1. I've been using 2.1 for a couple of weeks on my local development server, and everything works fine. I've just tried uploading to the production server, and I'm getting the error message:
Fatal error: Class 'Cache' not found in app/Config/core.php on line 265
I'm probably missing something obvious, but I can't work out what. If anyone has experienced something similar or can offer any suggestions I'd be very grateful!
(I'm using the CakePHP 2.1.0 stable release)

Are you very sure you uploaded all the "core" files (the lib directory)? It seems the Cache class is missing, which is a core class of CakePHP. The error message is indicating an incomplete CakePHP install on your server.
Verify if the file lib/Cake/Cache/Cache.php exists and is readable by the webserver you are using (e.g. ownership is set to apache.apache or www-data.www-data and chmod is set properly. If using SELinux, also make sure the files have httpd_sys_content_t or public_content_rw_t context set).

Related

Migrations in CakePHP 4 not working correctly?

I'm running a fresh install of CakePHP 4 and I'm trying to create an initial migration for the database. The migration itself is build correctly but the command fails to mark the migrations as done:
~/code$ bin/cake bake migration_snapshot Initial
Creating file /home/vagrant/code/config/Migrations/20200125204245_Initial.php
Wrote `/home/vagrant/code/config/Migrations/20200125204245_Initial.php`
Marking the migration 20200125204245_Initial as migrated...
Exception: Shell class for "Migrations" could not be found. If you are trying to use a plugin shell, that was loaded via $this->addPlugin(), you may need to update bin/cake.php to match https://github.com/cakephp/app/tree/master/bin/cake.php
In [/home/vagrant/code/vendor/cakephp/cakephp/src/Console/ShellDispatcher.php, line 332]
Since the migration is created successfully I'm pretty sure the plugin is installed correctly but somehow Bake can't access it?
The installed versions are:
CakePHP 4.0.2
CakePHP/Bake 2.0.4
CakePHP/Migrations 3.0.0-beta2
Apparently it's a bug and an issue has been created:
https://github.com/cakephp/bake/issues/638

Error "Mac is invalid" sometimes happen in Laravel project use AngularJS

I'm using Laravel 5.8 to create an admin system to manage data for my team.
My project is deployed on a VPS use Centos7.
The problem is that, i have deployed many projects on this VPS and they work OK. But with projects used AngularJS or Axios, when i send a request to server, i get error massage "The Mac is invalid!". But these errors do not always happen, just sometime (about 50%).
I have search and follow some instructions like Laravel - DecryptException: 'The MAC is invalid', but all not work.
I have cleared all my cache, rm bootstrap/cache/*, php artisan optimize:clear, check my .env file, setup new project with new ENV_KEY. But none of them work.
Can anyone give my some advises. Thank you!
I had the same problem, but that happend because i was using my HASH in production that was generated in development by the function encrypt()

extjs publish to local pc error could not find part of path

I'm not sure what happened here but I was always able to publish to my local pc for my ExtJs project. Now all of a sudden I am getting this error..
Error Copying file Sencha.sencha\app\app.defaults.json to obj\Release\Package\PackageTmp\Sencha.sencha\app\app.defaults.json failed. Could not find a part of the path 'Sencha.sencha\app\app.defaults.json'. ExtApplication4 0
I think I did upgrade version of ExtJs a while back but not sure this is what caused it.
I also notice the files don't exist when I look at solution explorer.
Any ideas? This is pretty vital to my whole situation.
Did you upgrade Sencha Cmd to 6.5x? This new version does not create the .sencha hidden folder anymore. You error seems to be related to this.

migration php 5 to php 7 cakephp

I am trying to make test environment for my cake project however the migration from php 5.X to 7.1.0 proves to be a nuisance.
I have succesfully installed a new fresh apache2.4 vc14 x64 bit installation.
This apache installation uses a fresh PHP vc14 x64 7.1.0 installation. Both have been checked and are indeed working perfectly.
Now the problem:
I have a cakephp product using a shared created library in the plugins folder, this was working perfectly in CakePHP 2.8.5 using php 5.x. This plugin is loaded in the bootstrap and used the way cakephp intends us to. However the moment i try to run the old project in the fresh installation it is suddenly unable the load the plugin files. Again everything is loaded in the bootstrap and usage has not been changed whilst moving the content to its new location. I have checked a fresh cakephp installation in the new environment and this is also working splenditly.
I am quite baffled at the moment has anyone having experience using cakephp encoutered this particular problem feel free to fire away with some ideas as to what i might have missed.
i will show some code how everything is loaded and used.
CakePlugin::Load('RemFlex');
<?php echo $this->Html->css('RemFlex.flexdetail'); ?>
<?php echo $this->Html->script('RemFlex.flexportal'); ?>
the plugin directory looks like this
Cakephp_program
-App
-Plugin
-RemFlex
-webroot
-js
-Css
-Controller
-Vendor
Fixed this problem by enabling the rewrite_module in the httpd.conf file of the apache installation. This enabled my htacces to actually work.

ERR_TOO_MANY_REDIRECTS after moving CakePHP project from a dedicated server to another dedicated server

I'm new to CakePHP and my employer asked me to move our CakePHP app from a dedicated server to another server (for testing purposes). I've copied all the files, changed app's database.php config but I'm getting a ERR_TOO_MANY_REDIRECTS when accessing the app on the new server.
I did not work on the app so I don't know much about it, but I have all the files.
LE: So, I've uploaded the app on a fresh install of CakePHP. I now have 3 .htaccess files, CakePHP says it's working, but when I try to upload DebugKit (following the install notes & having the proper version for CakePHP 2.4.3.) I get the ERR_TOO_MANY_REDIRECTS.
A look in Chrome's console shows me this. If I delete the DebugKit altogether, the page looks like this & it also has the footer from the app.
The new structure of the app is the standard one.
Please advise!
Best guess is the (apache?) DocumentRoot setting may be clashing with your APP config on the new server and/or the PHP settings. Have you checked your php.ini on the new server? What's the output of phpinfo() ? Once fixed HIGHLY RECOMMEND check other environment variables by turning on the DEBUG flag in config/app.php For your version try pr(Debugger::trace()); or even better for dev. install the Debug kit. Anyway, DocumentRoot should be set to webroot (assuming default install and directory structure).

Resources