-2

How Can I update the project from CakePHP 3 to CakePHP 4?

I have tried with install latest package of CakePHP 3.8 and convert to Cakephp 4 as per upgrade guide of CakePHP 4

It is not update properly, It display error as below

Missing Template::Error: The view for PagesController::display() was not found.
Confirm you have created the file: "Pages/welcome.ctp" in one of the following paths: /var/www/html/cake38/templates/Pages/home.ctp
Vivek Solanki
  • 136
  • 1
  • 13
  • 2
    You should focus on the exact issues you're facing rather that requesting an answer that would essentially be an unreliable copy of the migration guide you've already read. – Álvaro González Apr 04 '20 at 12:10

1 Answers1

3

You don't have to care about these two warnings until after you've upgraded to 4.x (run composer outdated, it will show you abandoned packages). If they still exist, then check your composer.lock file and search for the package names to figure out by which packages they are being required, and then see if there's updated versions of those packages that you can use.

The changes that you need to make for an upgrade are pretty much outlined in the migration guide, there isn't really a point here in repeating them. You should do the regular upgrading process, that is:

  1. upgrade your composer dependencies
  2. upgrade your application skeleton files/structure according to the target version (config, binaries, shells, etc, see https://github.com/cakephp/app/tree/3.8.0)
  3. run your testsuite and fix the failures.

Once you're on 3.8 and have fixed everything, follow the 4.0 upgrade guide, ie:

  1. run the upgrade tool
  2. then again upgrade your dependencies, run your testsuite, and fix the failures.

Usually the deprecation messages kinda tell you how to fix things, ie they tell you what to use instead of the deprecated code. If you have a problem with some specific deprecations that you don't know how to fix, then I'd suggest that you elaborate on them. For some quick help you're probably better off asking about it in the CakePHP Slack/IRC channel.

As for the .ctp files, if the problem still exists after the upgrade to 4.x, then search your application code as well as the vendor code for the string ctp to figure out where there might still be references left to that, it's not a problem for which there is a general solution.

ndm
  • 59,784
  • 9
  • 71
  • 110