# \#help

**URL:** https://discourse.cakephp.org/tag/help/8.md

[Latest](https://discourse.cakephp.org/latest.md) · [Categories](https://discourse.cakephp.org/categories.md) · [Tags](https://discourse.cakephp.org/tags.md)

---

## [Error coming when trying to run server or do migrations](https://discourse.cakephp.org/t/error-coming-when-trying-to-run-server-or-do-migrations/12828)

<div class="topic-metadata">

**Author:** [@abhay-ops](https://discourse.cakephp.org/u/abhay-ops)\
**Replies:** 3\
**Last updated:** [August 20, 2026, 2:07pm UTC](https://discourse.cakephp.org/t/error-coming-when-trying-to-run-server-or-do-migrations/12828 "2026-08-20T14:07:20Z")

</div>

This error is coming from where whenever I try any console command from cake, like bin/cake server or bin/cake migrations migrate. Error that I am getting:- bin/cake migrations migrate PHP Fatal error: Cannot redeclar…

---

## [CakePHP 5 upgrade and Authentication](https://discourse.cakephp.org/t/cakephp-5-upgrade-and-authentication/12847)

<div class="topic-metadata">

**Author:** [@bgrinter](https://discourse.cakephp.org/u/bgrinter)\
**Replies:** 12\
**Last updated:** [May 30, 2026, 10:55am UTC](https://discourse.cakephp.org/t/cakephp-5-upgrade-and-authentication/12847 "2026-05-30T10:55:21Z")

</div>

I’ve started going through the process to migrate a fairly large app from v4.6 to v5.3.5. So far, I’ve gone fairly well and I’m presented with a login screen - not too bad for an afternoon’s work :stuck\_out\_tongue: Now…

---

## [Need to upgrade CakePHP 2.x. to CakePHP 5.3](https://discourse.cakephp.org/t/need-to-upgrade-cakephp-2-x-to-cakephp-5-3/12829)

<div class="topic-metadata">

**Author:** [@prem](https://discourse.cakephp.org/u/prem)\
**Replies:** 1\
**Last updated:** [April 22, 2026, 4:26pm UTC](https://discourse.cakephp.org/t/need-to-upgrade-cakephp-2-x-to-cakephp-5-3/12829 "2026-04-22T16:26:23Z")

</div>

My current project is built on CakePHP 2.x. I would like to upgrade it to CakePHP 5.3. Could you please provide the recommended approach, including necessary commands and migration steps?

---

## [Cake 5.3 + Authentication plugin 4.x - exception Identifier configuration must specify a class name](https://discourse.cakephp.org/t/cake-5-3-authentication-plugin-4-x-exception-identifier-configuration-must-specify-a-class-name/12820)

<div class="topic-metadata">

**Author:** [@batsssss](https://discourse.cakephp.org/u/batsssss)\
**Replies:** 3\
**Last updated:** [April 8, 2026, 9:05pm UTC](https://discourse.cakephp.org/t/cake-5-3-authentication-plugin-4-x-exception-identifier-configuration-must-specify-a-class-name/12820 "2026-04-08T21:05:04Z")

</div>

I have recently upgraded an old project from CakePHP 4.3 to 5.3, according to the migration guides: 1) updated from 4.3 to 4.6, 2) applied the Upgrade/rector/migration tool to upgrade to 5.x, 3) updated to 5.3. I then in…

---

## [How can I handle unfound records?](https://discourse.cakephp.org/t/how-can-i-handle-unfound-records/12783)

<div class="topic-metadata">

**Author:** [@SharonGilmore](https://discourse.cakephp.org/u/SharonGilmore)\
**Replies:** 4\
**Last updated:** [January 19, 2026, 10:09am UTC](https://discourse.cakephp.org/t/how-can-i-handle-unfound-records/12783 "2026-01-19T10:09:36Z")

</div>

I’ve built my app in CakePHP 5, and it’s all working basically fine, but now I want to handle cases like a user trying to access a page that doesn’t exist. For example, currently in my admin area I have the route /admin…

---

## [A couple of issues with the dereuromark cakephp-comments plugin on storing comment data](https://discourse.cakephp.org/t/a-couple-of-issues-with-the-dereuromark-cakephp-comments-plugin-on-storing-comment-data/12758)

<div class="topic-metadata">

**Author:** [@Poffen](https://discourse.cakephp.org/u/Poffen)\
**Replies:** 2\
**Last updated:** [December 21, 2025, 3:05pm UTC](https://discourse.cakephp.org/t/a-couple-of-issues-with-the-dereuromark-cakephp-comments-plugin-on-storing-comment-data/12758 "2025-12-21T15:05:18Z")

</div>

Hi there. First I should say that I am fairly new to cakephp, so bear with me. I am trying to implement the dereuromark comments plugin in my test environment (cakephp 5.2, cakedc/users plugin and dereuromark cakephp-com…

---

## [CakeDC/Users Plugin Token Authentication / Identifier](https://discourse.cakephp.org/t/cakedc-users-plugin-token-authentication-identifier/12757)

<div class="topic-metadata">

**Author:** [@hannenz](https://discourse.cakephp.org/u/hannenz)\
**Replies:** 1\
**Last updated:** [December 20, 2025, 11:41am UTC](https://discourse.cakephp.org/t/cakedc-users-plugin-token-authentication-identifier/12757 "2025-12-20T11:41:08Z")

</div>

I want to setup CakeDC/Users plugin to allow FormAuthentication plus also Token Authentication for API enfpoints. FormLogin etc. is working but I cannot get the Token Authentication working. From what I was able to debug…

---

## [Re: Breadcrumb $options lost when $title is an array](https://discourse.cakephp.org/t/re-breadcrumb-options-lost-when-title-is-an-array/12750)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.cakephp.org/u/alex)\
**Replies:** 2\
**Last updated:** [December 16, 2025, 5:38pm UTC](https://discourse.cakephp.org/t/re-breadcrumb-options-lost-when-title-is-an-array/12750 "2025-12-16T17:38:49Z")

</div>

I raised an issue on Github thinking it was a bug, but apparently it’s a feature. Now I have a follow-up question (for learning purposes) which I decided to ask here so that I don’t clutter Github. The original issue I …

---

## [CakePHP in a non standard port](https://discourse.cakephp.org/t/cakephp-in-a-non-standard-port/12725)

<div class="topic-metadata">

**Author:** [@dcoturel](https://discourse.cakephp.org/u/dcoturel)\
**Replies:** 4\
**Last updated:** [October 16, 2025, 6:47am UTC](https://discourse.cakephp.org/t/cakephp-in-a-non-standard-port/12725 "2025-10-16T06:47:49Z")

</div>

Hi! I have a CakePHP 4 app developed and running in several onpremises customers. In one of those, they provided me a public location consisting of an URL and a non standard port: https://application.domain.com:8091 T…

---

## [How do I upgrade cake php from 2.8.3 to the version 5](https://discourse.cakephp.org/t/how-do-i-upgrade-cake-php-from-2-8-3-to-the-version-5/12727)

<div class="topic-metadata">

**Author:** [@kovarex](https://discourse.cakephp.org/u/kovarex)\
**Replies:** 5\
**Last updated:** [October 15, 2025, 5:32pm UTC](https://discourse.cakephp.org/t/how-do-i-upgrade-cake-php-from-2-8-3-to-the-version-5/12727 "2025-10-15T17:32:49Z")

</div>

Hello, I’m trying to migrate page using cake php to a new server, which is also using up to date version of php. Based on the error messages and search, it seems like I can’t use 2.8.3 version anymore as it won’t work …

---

## [My page is requiring login when it didn't previously](https://discourse.cakephp.org/t/my-page-is-requiring-login-when-it-didnt-previously/12704)

<div class="topic-metadata">

**Author:** [@SharonGilmore](https://discourse.cakephp.org/u/SharonGilmore)\
**Replies:** 2\
**Last updated:** [October 15, 2025, 12:45pm UTC](https://discourse.cakephp.org/t/my-page-is-requiring-login-when-it-didnt-previously/12704 "2025-10-15T12:45:09Z")

</div>

I created a site in CakePHP 5 a couple of years ago, and a couple of weeks ago my client reported that “one of the pages in the admin area isn’t working”. They last accessed it a year ago and it was ok then. The admin …

---

## [Cakephp 5 timezone configuration](https://discourse.cakephp.org/t/cakephp-5-timezone-configuration/12714)

<div class="topic-metadata">

**Author:** [@koepper](https://discourse.cakephp.org/u/koepper)\
**Replies:** 1\
**Last updated:** [September 23, 2025, 2:38pm UTC](https://discourse.cakephp.org/t/cakephp-5-timezone-configuration/12714 "2025-09-23T14:38:46Z")

</div>

I have created a cakephp 5 app with a mysql database running in UTC time. I want all datetime fields in the database in UTC. But the user resides in the timezone Europe/Paris. So I show all datetime values via the i18nFo…

---

## [Cake\\ORM\\Marshaller::\_mergeAssociation(): Argument #1 ($original) must be of type Cake\\Datasource\\EntityInterface|array|null, int given,](https://discourse.cakephp.org/t/cake-orm-marshaller-mergeassociation-argument-1-original-must-be-of-type-cake-datasource-entityinterface-array-null-int-given/12632)

<div class="topic-metadata">

**Author:** [@smoeckel](https://discourse.cakephp.org/u/smoeckel)\
**Replies:** 10\
**Last updated:** [August 24, 2025, 8:07am UTC](https://discourse.cakephp.org/t/cake-orm-marshaller-mergeassociation-argument-1-original-must-be-of-type-cake-datasource-entityinterface-array-null-int-given/12632 "2025-08-24T08:07:45Z")

</div>

Tried to post more details. Forum response was: An error occurred: Sorry, new users can only mention 2 users in a post. Version: 5.2.5 Same code works in Version: 4.5.8 This is not a migration, clean install. I have s…

---

## [Swagger with CakePHP 5.x](https://discourse.cakephp.org/t/swagger-with-cakephp-5-x/12605)

<div class="topic-metadata">

**Author:** [@VishalPanchal45](https://discourse.cakephp.org/u/VishalPanchal45)\
**Replies:** 2\
**Last updated:** [August 4, 2025, 12:09pm UTC](https://discourse.cakephp.org/t/swagger-with-cakephp-5-x/12605 "2025-08-04T12:09:22Z")

</div>

I am using alt3/Swagger with cakephp 4.5.9 . But now I want to upgrade cakephp to 5.x but alt3/swagger has no supported version. Please guide. Is thetre any alternative?

---

## [Best Practice for Calculated Fields](https://discourse.cakephp.org/t/best-practice-for-calculated-fields/12653)

<div class="topic-metadata">

**Author:** [@jmcmonagle](https://discourse.cakephp.org/u/jmcmonagle)\
**Replies:** 5\
**Last updated:** [July 23, 2025, 2:17pm UTC](https://discourse.cakephp.org/t/best-practice-for-calculated-fields/12653 "2025-07-23T14:17:19Z")

</div>

I am looking for advice on what the best practice is for implementing my calculated fields in CakePHP 5. I have a model that is Projects hasMany ProjectExpenses which hasMany ProjectExpenseLineItems. Users record expen…

---

## [Migration from 4.0.7 to?](https://discourse.cakephp.org/t/migration-from-4-0-7-to/12609)

<div class="topic-metadata">

**Author:** [@dantedantas](https://discourse.cakephp.org/u/dantedantas)\
**Replies:** 1\
**Last updated:** [July 6, 2025, 10:16am UTC](https://discourse.cakephp.org/t/migration-from-4-0-7-to/12609 "2025-07-06T10:16:21Z")

</div>

Hello everyone. My project is currently using: CakePHP 4.0.7 XAMPP 3.2.4 MSSQL Server 16 PHP 7.4 But we need to migrate to a new server, this server is set with a more updated environment. XAMPP 3.3.0 MSSQL Serve…

---

## [Friendsofcake/crud support with cakephp 5.x](https://discourse.cakephp.org/t/friendsofcake-crud-support-with-cakephp-5-x/12604)

<div class="topic-metadata">

**Author:** [@VishalPanchal45](https://discourse.cakephp.org/u/VishalPanchal45)\
**Replies:** 1\
**Last updated:** [June 30, 2025, 2:00pm UTC](https://discourse.cakephp.org/t/friendsofcake-crud-support-with-cakephp-5-x/12604 "2025-06-30T14:00:50Z")

</div>

I am using cakephp 4.5.9 and friendsofcake/crud 6.2.0 . Now, Due to vunerability issues I need to upgrade my cakephp version to 5.1.4 but I found that friendsofcake/crud hasn’t compatible version for that. Please confirm…

---

## [When used http client cakephp 3 Cannot Get Response](https://discourse.cakephp.org/t/when-used-http-client-cakephp-3-cannot-get-response/10707)

<div class="topic-metadata">

**Author:** [@wakikuk](https://discourse.cakephp.org/u/wakikuk)\
**Replies:** 3\
**Last updated:** [May 21, 2025, 12:13am UTC](https://discourse.cakephp.org/t/when-used-http-client-cakephp-3-cannot-get-response/10707 "2025-05-21T00:13:35Z")

</div>

i’ll tried to request with http client, to url : https://equran.id/api/surat/1 , that my code public $urlquran = "https://equran.id/api/surat"; public function getayat($randomsurat =null){ $http = new Client(); …

---

## [Paginator for cakephp5. x. The URL on the next page has removed fields with empty values](https://discourse.cakephp.org/t/paginator-for-cakephp5-x-the-url-on-the-next-page-has-removed-fields-with-empty-values/12568)

<div class="topic-metadata">

**Author:** [@maxg](https://discourse.cakephp.org/u/maxg)\
**Replies:** 3\
**Last updated:** [May 13, 2025, 11:31am UTC](https://discourse.cakephp.org/t/paginator-for-cakephp5-x-the-url-on-the-next-page-has-removed-fields-with-empty-values/12568 "2025-05-13T11:31:11Z")

</div>

Click the ‘检索’ button Click the ‘next\>’ button The null value in the path has been deleted, I don’t want to delete it. cakephp5.x\>users UsersController.php protected array $paginate = \[ 'limit' =\> 5, …

---

## [Version Upgrade from 2.x to 5.x](https://discourse.cakephp.org/t/version-upgrade-from-2-x-to-5-x/12328)

<div class="topic-metadata">

**Author:** [@Nutan](https://discourse.cakephp.org/u/Nutan)\
**Replies:** 4\
**Last updated:** [May 2, 2025, 2:02pm UTC](https://discourse.cakephp.org/t/version-upgrade-from-2-x-to-5-x/12328 "2025-05-02T14:02:10Z")

</div>

I have project with cakephp 2.X . Customer want to upgrade in cakephp 5.x . Is there plugin which help me for this . Which can show deprecated methods in VS Code and provide anything helpful suggesion in VS code. I want…

---

## [CMS tutorial issue for a newbe](https://discourse.cakephp.org/t/cms-tutorial-issue-for-a-newbe/12546)

<div class="topic-metadata">

**Author:** [@Ricardo](https://discourse.cakephp.org/u/Ricardo)\
**Replies:** 1\
**Last updated:** [April 18, 2025, 4:01am UTC](https://discourse.cakephp.org/t/cms-tutorial-issue-for-a-newbe/12546 "2025-04-18T04:01:35Z")

</div>

Hello, I just started to learn PHP/CakePHP. I’m a Systems Engineer so, I’m very familiar with coding, but in my old days the languages were others: VB, COBOL, Pascal, etc. So, moving into a WEB development is a challenge…

---

## [A route matching "array ( 'prefix' =\> 'Api', 'controller' =\> 'Admins', 'action' =\> 'login', 'plugin' =\> 'DebugKit', '\_ext' =\> NULL, )" could not be found](https://discourse.cakephp.org/t/a-route-matching-array-prefix-api-controller-admins-action-login-plugin-debugkit-ext-null-could-not-be-found/12532)

<div class="topic-metadata">

**Author:** [@clarenz](https://discourse.cakephp.org/u/clarenz)\
**Replies:** 1\
**Last updated:** [April 8, 2025, 1:47pm UTC](https://discourse.cakephp.org/t/a-route-matching-array-prefix-api-controller-admins-action-login-plugin-debugkit-ext-null-could-not-be-found/12532 "2025-04-08T13:47:58Z")

</div>

I’m trying to make the default route into /Api/Admins/login whenever the project is opened using this route: $builder-\>connect('/', \['prefix' =\> 'Api', 'controller' =\> 'Admins', 'action' =\> 'login'\]); this is because m…

---

## [Method 'App\\Policy\\UsersTablePolicy::beforeScope()' is not compatible with method](https://discourse.cakephp.org/t/method-app-policy-userstablepolicy-beforescope-is-not-compatible-with-method/12471)

<div class="topic-metadata">

**Author:** [@lish](https://discourse.cakephp.org/u/lish)\
**Replies:** 7\
**Last updated:** [March 14, 2025, 3:45am UTC](https://discourse.cakephp.org/t/method-app-policy-userstablepolicy-beforescope-is-not-compatible-with-method/12471 "2025-03-14T03:45:57Z")

</div>

Fatal error : Declaration of App\\Policy\\UsersTablePolicy::beforeScope(Authorization\\IdentityInterface $user, Cake\\Database\\Query $query, string $action): Cake\\Database\\Query must be compatible with Authorization\\Policy\\B…

---

## [Customize message in requirePresence validation](https://discourse.cakephp.org/t/customize-message-in-requirepresence-validation/12472)

<div class="topic-metadata">

**Author:** [@MDebus](https://discourse.cakephp.org/u/MDebus)\
**Replies:** 3\
**Last updated:** [March 10, 2025, 2:47pm UTC](https://discourse.cakephp.org/t/customize-message-in-requirepresence-validation/12472 "2025-03-10T14:47:35Z")

</div>

Hi there, i can’t customize my message in requirePresence Validation: $validator-\>requirePresence(\[ 'user\_id' =\> \[ 'mode' =\> 'create', 'message' =\> 'My custom message.', \] \]); $validator-\>r…

---

## [Sending Emails with Gmail in CakePHP Now That OAuth is Required](https://discourse.cakephp.org/t/sending-emails-with-gmail-in-cakephp-now-that-oauth-is-required/12434)

<div class="topic-metadata">

**Author:** [@gvenuto](https://discourse.cakephp.org/u/gvenuto)\
**Replies:** 1\
**Last updated:** [March 1, 2025, 8:22pm UTC](https://discourse.cakephp.org/t/sending-emails-with-gmail-in-cakephp-now-that-oauth-is-required/12434 "2025-03-01T20:22:28Z")

</div>

Google has announced that starting September 30, 2024, it will require OAuth for sending emails via Gmail, as stated in this support article. I’m currently using CakePHP 5 and the built-in Cake\\Mailer\\Mailer class to se…

---

## [How call cell() with options for config (Cake 5.1)](https://discourse.cakephp.org/t/how-call-cell-with-options-for-config-cake-5-1/12431)

<div class="topic-metadata">

**Author:** [@theasy](https://discourse.cakephp.org/u/theasy)\
**Replies:** 3\
**Last updated:** [February 26, 2025, 2:46pm UTC](https://discourse.cakephp.org/t/how-call-cell-with-options-for-config-cake-5-1/12431 "2025-02-26T14:46:21Z")

</div>

How is it possible with the call of $this-\> Cell (‘cellnamefile’, \[‘name’\],\[‘config’ =\> ‘xyz’, ‘label’ =\> ‘formlable’\]) options or arguments for the config, to be given to display() ?

---

## [Get Related Record ID Value](https://discourse.cakephp.org/t/get-related-record-id-value/12425)

<div class="topic-metadata">

**Author:** [@Foggies](https://discourse.cakephp.org/u/Foggies)\
**Replies:** 2\
**Last updated:** [February 26, 2025, 1:24pm UTC](https://discourse.cakephp.org/t/get-related-record-id-value/12425 "2025-02-26T13:24:11Z")

</div>

Hello guys, I’m using CakePHP 5. I have a few tables: Webs (id) Audits (id, web\_id, session\_id, user\_id) Sessions (id, name) Users (id, fullname) When I open web views, for example …/webs/view/1, it will show the rel…

---

## [How does CakePHP know not to run initialize() on any given controller?](https://discourse.cakephp.org/t/how-does-cakephp-know-not-to-run-initialize-on-any-given-controller/12418)

<div class="topic-metadata">

**Author:** [@alex](https://discourse.cakephp.org/u/alex)\
**Replies:** 1\
**Last updated:** [February 12, 2025, 4:10pm UTC](https://discourse.cakephp.org/t/how-does-cakephp-know-not-to-run-initialize-on-any-given-controller/12418 "2025-02-12T16:10:00Z")

</div>

Hi everyone Just curious, how does CakePHP understand that public function initialize() {} is not to be executed on a controller? Just tried to visit /example/initialize and got Missing Method in ExampleController. Is t…

---

## [CakeDto Plugin - Class Not Found](https://discourse.cakephp.org/t/cakedto-plugin-class-not-found/11714)

<div class="topic-metadata">

**Author:** [@NickS](https://discourse.cakephp.org/u/NickS)\
**Replies:** 4\
**Last updated:** [January 21, 2025, 4:31pm UTC](https://discourse.cakephp.org/t/cakedto-plugin-class-not-found/11714 "2025-01-21T16:31:55Z")

</div>

I’ve been following the ReadMe for @dereuromark CakeDto Plugin at: cakephp-dto/docs/README.md at master · dereuromark/cakephp-dto (github.com) This is a fresh CakePHP 5.0.3 + PHP 8.2 install - everything is working gr…

---

## [Response within the application](https://discourse.cakephp.org/t/response-within-the-application/12387)

<div class="topic-metadata">

**Author:** [@dokmana](https://discourse.cakephp.org/u/dokmana)\
**Replies:** 2\
**Last updated:** [January 18, 2025, 8:09am UTC](https://discourse.cakephp.org/t/response-within-the-application/12387 "2025-01-18T08:09:50Z")

</div>

Hi I would like to understand what the proper way is to return status and status information within the application. For example when a controller calls a component or a command calls a service. I would like to get a st…

[Next page](https://discourse.cakephp.org/tag/help/8.md?match_all_tags=true&page=1&tags%5B%5D=help)
