Questions tagged [cakephp]

CakePHP is an open-source web, rapid development framework for PHP that provides an extensible architecture for developing, maintaining, and deploying applications. It uses commonly known design patterns like MVC and ORM within the convention over configuration paradigm.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

cakephp 4 cannot find a finder method

I had a finder method called "findActive" in my CarsTable.php , I call it from another controller: VehiclesController.php : CarsTable.php public function findActive(Query $query, array $...
R0bertinski's user avatar
-1 votes
0 answers
44 views

I notice that i have got error when will i run bin/cake servrer on my linux terminal I already install latest version of composer and php in my system

i have php latest version 8.2.10 composer version 2.6.3 when i want to launch my cake php to type this command bin/cake server i got this error please give the solution PHP Warning: require(/opt/...
vivek's user avatar
  • 1
0 votes
0 answers
10 views

Cakephp Deployment to web hosting Missing Helpers Error

Its my first time using cakephp to deploy in web hosting and i already configured the database and now it's connected. my homepage and css display correctly but when i press login i won't get to the ...
Rest's user avatar
  • 1
0 votes
0 answers
30 views

PhpStorm "Unknown named parameter" Error With CakePHP 5.x

I recently created a new project in CakePHP 5 which is PHP 8.1+ compatible and accepts named parameters. I freshly baked a model and in the controller, when using PhpStorm (2023.1.2), I get a ...
Russell Toris's user avatar
0 votes
0 answers
40 views

Cakephp 4 passing sub query from controller to view

I'm trying to create a summary of orders from the database each line in the database contains a sepertate row for each item and is linked together by an order number so for example. Order_number item ...
infobuster's user avatar
0 votes
0 answers
18 views

CakePHP 3 - Association not defined..?

I am trying to create a new many-to-many relationship in CakePHP 3 project. I have the association defined, but somehow it still claims it is not... and i can't figure out why. I believe i have ...
J.B.J.'s user avatar
  • 440
-1 votes
0 answers
21 views

CakePHP SQLSTATE[42000]: Syntax error or access violation

I am updating a CakePHP4 aplication from MySQL 5 to MySQL 8. This is the function on my controller that triggers the error: public function addElement($contentTypeKey, $pageId, $row, $col) { ...
mrodo's user avatar
  • 563
0 votes
0 answers
22 views

Migration to CakePHP 4.4 undefined method in Entity problem

I am migrating from CakePHP 3.10 to CakePHP 4.4. My code worked fine in the previous version of the framework. At this moment I am getting error: "Call to undefined method App\Model\Entity\A1::...
Annabelle's user avatar
  • 734
0 votes
0 answers
22 views

CakePHP 4.4: a table has many itself

I have the NursingRegisters table, which in addition to the id field has the date field. More than one record can be inserted for the same date. Now I would like to group the records by date. Normally ...
Mirko Pagliai's user avatar
0 votes
0 answers
14 views

Cakephp 4.X - Add via plugin a script block in every page/view

I have a question about Cakephp 4.X. Maybe you know a simple and quick way to permanently add a Javascript file to all views in the script block using the plugin system. How can this be achieved?
ProfDaniBest's user avatar
0 votes
1 answer
17 views

in cakephp 4, test function, viewVariable return null

I need to test variables set by a controller method, but I get a null value Here is some code : The controller function: public function setLastDay() { $this->set('lastDay', 99); } The test ...
dype's user avatar
  • 500
0 votes
1 answer
24 views

CakePHP 4 HTML Helper Link Outside of Prefix

I set up a prefix for cooking related sections of my application and moved the controllers/views into the appropriate 'Cooking' directories (e.g., cooking/recipes, cooking/ingredients, etc). When I ...
Russell Toris's user avatar
0 votes
1 answer
43 views

General error: 1364 Field doesn't have a default value after upgrade to 4.4 from low 3.3

I'm currently working on finalizing an upgrade from CakePHP 3.3 to 4.4. I now have the same problem in a few places, which all are the same SQLSTATE error: SQLSTATE[HY000]: General error: 1364 Field '...
dyXur's user avatar
  • 5
0 votes
1 answer
16 views

I want to add Multiple records to database which are dynamically generated based on certain selections in cakephp2.6.1

I am trying to generate semester rows dynamically based on selections and inputs and store all of them at the same. <pre> public function saveData() { $this->autoRender = false; // ...
Roshan Bende's user avatar
0 votes
0 answers
23 views

Where do I put custom helper functions for CakePHP 4.0 model logic

Sorry if this has been asked I've been searching documentation and stack overflow and can't find it being solved. Here is my scenario. I have a model for a league, this model has many teams, each team ...
Hazmit's user avatar
  • 165
0 votes
1 answer
37 views

CakePHP 3 upgrade to 4 - Routing missing?

i am trying to upgrade a CakePHP 3 project to CakePHP 4. Have gone through all the migration steps, which updates the files, but when i fire up the program it just displays: Fatal error: Uncaught ...
J.B.J.'s user avatar
  • 440
0 votes
1 answer
37 views

CakePHP 4.4: retrieve data that contains an association that matches an association

I need an indication, having not been able to find anything about it (but maybe it's my fault...). An indication also to the CakeBook will be fine. In my application I have the PatientsTable. A ...
Mirko Pagliai's user avatar
0 votes
0 answers
23 views

Query with ->matching() multiple arguments returns empty array in CakePHP4

I want to show on a page list of news from different facilities. To achieve that i retrieve data from corresponding tables. Also I added a search engine by month and stuck with a matching information ...
Signor's user avatar
  • 1
0 votes
1 answer
40 views

FrozenDate::parseDate doesn't work with September

Is there a reason why FrozenDate::parseDate, called with the month of September (ex. Sep), the date doesn't get parsed? Code: $months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','...
TechFanDan's user avatar
  • 3,349
-1 votes
1 answer
82 views

CakePHP 3 to PHP 8.1 - Composer errors? [duplicate]

My CakePHP 3 project needs to be updated to support PHP 8.1, but i can't get the composer update to work. Whenever i do, i get these errors: Problem 1 - cakephp/cakephp[3.9.0, ..., 3.9.3] require ...
J.B.J.'s user avatar
  • 440
0 votes
2 answers
42 views

Routing Middleware does not preserve headers

I try to handle CORS for the API scoped route. If i get an OPTION request i return the response immediately so the application does not have to handle it. But if i receive a GET request i add the ...
Robin Reist's user avatar
0 votes
0 answers
17 views

CakePHP 1.3.7 - Renaming className in Model file breaks login page

I have an install of Cake 1.3.7 which I inherited from a previous developer for one of my clients. There is a model that includes the following: var $belongsTo = array( [. . .] 'TimeSlot' => ...
DiMono's user avatar
  • 3,318
0 votes
0 answers
100 views

CakePHP Deprecated FactoryTrait?

I got a new PC and is setting up my CakePHP project on it, but i get these errors: Deprecated: Return type of Cake\Chronos\Traits\FactoryTrait::createFromFormat($format, $time, $tz = null) should ...
J.B.J.'s user avatar
  • 440
0 votes
0 answers
11 views

facing issues with my CakePHP 2 application not loading the webroot

i'm using PHPDesktop to package a CakePHP 2 project and create a standalone desktop application but facing issues with my CakePHP 2 application not loading the webroot reasons why did not webroot load ...
elmehdi tachtoukt's user avatar
0 votes
1 answer
50 views

Express sub-query in SELECT in CakePHP 2.x

Abstracting as much as possible, I want to perform: select id,complicatedCalculation as geodistance from User join others having geodistance < 100; In CakePHP 2.x. The actual query uses ...
Michael NGV's user avatar
0 votes
0 answers
39 views

PHP: CakePHP call to undefined function when importing it from a different Namespace

I'm quite new to PHP and Namespacing. I'm trying to use cakePHP to develop a website and i'm stuck with a problem regarding the use of a function imported from a different namespace. the problem is ...
Dino's user avatar
  • 1
0 votes
0 answers
19 views

Activated AWS CDN - Keep receiving "X-Cache: Miss from cloudfront"

I just activated AWS CDN, and all I see is "X-Cache: Miss from cloudfront". Also I see "max-age=0" which I don't know where it's coming from. Checking the code (cakePhP), I don't ...
shabk's user avatar
  • 51
0 votes
0 answers
27 views

Firebase Realtime Database request issue with CakePHP

After recovering one of my project on Git, I realized that my CakePHP app can no longer make get requests to my Firebase Realtime Database First of all I use the ktamas77 lib (https://github.com/...
ImperialCZ's user avatar
0 votes
0 answers
39 views

Using a Single Template for Both Edit and View Methods in CRUD Plugin for CakePHP

I have PHP experience but first time working with CakePHP 4. "cakephp/cakephp": "~4.4", "friendsofcake/crud": "^6.1.1" The project is using the friends of ...
Jean Riker's user avatar
0 votes
0 answers
32 views

CakePHP session and cache handling

If there are login issues associated with a CakePHP application, is there something specific that one should be looking at ? I understand the permissions should be correctly configured on the tmp ...
RKP's user avatar
  • 1
0 votes
0 answers
304 views

How to properly configure NGINX to serve Vite-React front-end container and CakePHP API back-end container

I'm currently trying to config my NGINX docker instance to serve both front and back-end services to create a brand new applications with: CakePHP as my Back-End RestAPI; ReactJs as my Front-End; ...
eddyxide's user avatar
0 votes
0 answers
38 views

Upgrade cakephp 3.10 to cakephp 4 throws Hash::insert() error

Following all the migration steps from the CakePHP manual, I end up with a error 500 on all pages. The log tells me this: > [Wed Jul 19 11:56:02.566953 2023] [proxy_fcgi:error] [pid 12776] > [...
Joost's user avatar
  • 418
0 votes
0 answers
33 views

How to get Room Available between checkin datetime and checkout datetime

I have 3 tables in my database. First table is rooms , second table is booking_details and third is reserved_rooms. i user cakephp4.2, mysql. rooms Table enter image description here booking_details ...
Yogesh Saini's user avatar
0 votes
0 answers
56 views

Not able to connect to SQL Server with cakephp

While trying to link CakePHP and SQL Server got a message :"CakePHP is NOT able to connect to the database. Database connection "Sqlserver" is missing, or could not be created." I ...
Signor's user avatar
  • 1
0 votes
1 answer
32 views

Sharing variables between CakePHP 4 view blocks

I have a "general" layout template, in which I would like to define a general set of options to pass to all the forms I'm creating in the specialized templates the contain the blocks I'm ...
mrodo's user avatar
  • 563
0 votes
0 answers
93 views

Web server becomes unresponsive while making multiple cURL requests in PHP

(Edited for clarity) In a CakePHP 4 controller I have a foreach loop within which I do the following. $ch = curl_init($requestConfig['url']); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, ...
Simon's user avatar
  • 123
0 votes
0 answers
31 views

Redirect issues when upgrading CakePHP version with Cakedc/users

I am trying to upgrade the backend version from Cakephp3.8 to Cakephp4.4 I used upgrade tools and update composer and the versions of the modules. One of the problem is that after upgrading, I have ...
Morgan Harris's user avatar
0 votes
0 answers
27 views

How do I upgrade version of cakephp2.0 to cakephp3 and cakephp4 step by step?

According to the topic, I want to upgrade the cakephp2.0 version to next cakehp3.0 version. Change version as soon as possible. I have tried but there were change all the files of project and this ...
Neha's user avatar
  • 1
0 votes
1 answer
31 views

Understanding how CakePHP 3 is serving static images

I have an image located in the webroot/uploads/files folder. This image is being served statically by CakePHP. I am trying to better understand how to control this mechanism. I have removed every ...
wmdvanzyl's user avatar
  • 352
0 votes
0 answers
54 views

MySQL Database disconnecting randomly from PHP application

We are facing an issue in which the Mysql connection disconnects or gets timeout randomly from the PHP application. We have 3 PHP applications on 2 different servers all of these are having this issue ...
Ekky's user avatar
  • 790
0 votes
0 answers
68 views

Fatal Error: Declaration of CakeDC\OracleDriver\Database\OCI8\OCI8Connection::query must be compatible with PDO::query ( Cake Php 4.4.14 )

I am created a project on cake php and try to connect with an oracle instance provided from my office to work on that oracle database. I installed CakePHP 4 Driver which is get from Github CakePHP 4 ...
Jahir509's user avatar
0 votes
1 answer
64 views

Using uuid for edit/delete in CRUD

CakePHP 4.4.14 friendsofcake/crud: 6.2.0 For simply security reasons and also not to reveal the amount of rows in the table I want to use the uuid field for the edit/delete actions. Usually it works ...
Peter VARGA's user avatar
  • 4,830
0 votes
0 answers
124 views

RabbitMQ php-amqplib ERROR Connection reset by peer and Broken pipe or closed connection

After processing the message successfully, the consumer returns error "Error: [PhpAmqpLib\Exception\AMQPConnectionClosedException] Connection reset by peer" The message takes about 1000 ...
Rocetti Rinke's user avatar
0 votes
0 answers
15 views

Cakephp, how to see Sqlite rowid

friends! I'm working with SQLite for the first time on Cakephp and I perceive that the "rowid" field (https://www.sqlite.org/rowidtable.html) is not being retrieved whem I use "Entity-&...
MaLSan's user avatar
  • 11
0 votes
0 answers
96 views

"Openssl extension is required for SSL/TLS Error" while running php composer.phar install in cakephp

I am setting up Cakephp project in my local system. I have git cloned the project inside the htdocs folder of Xaamp. When I run "php composer.phar install" it gives me this error "The ...
Shubham Upadhyay's user avatar
0 votes
1 answer
72 views

Crud/CakePHP: placing findMethod in the controller

I am referring to this documentation: https://crud.readthedocs.io/en/latest/actions/index.html#findmethod Is there a way to place the find method in the controller, instead in App\Model\Table? What I ...
Peter VARGA's user avatar
  • 4,830
0 votes
1 answer
37 views

CakePHP: Debug messages not shown

I have in config/app_local.php this code: return [ /* * Debug Level: * * Production Mode: * false: No error messages, errors, or warnings shown. * * Development Mode: ...
Peter VARGA's user avatar
  • 4,830
0 votes
1 answer
55 views

CakePHP 4 Query: I don't need created_at as FrozenTime, string is enough

Sometimes when I get data from database, i want data as array - method disableHydration() does it. But timestamp fields (in the database) are still returned as objects FrozenTime. Is it possible (and ...
Cyb's user avatar
  • 18
0 votes
1 answer
64 views

Cakephp I18n setLocale doesn't change language

I have a Cakephp 4 project internationalization used to work but today I tried it changing the PC and it didn't change the language and doesn't give any error. I have this methid to change language in ...
Iria 's user avatar
0 votes
0 answers
23 views

cakephp Form helper, radio does not work as expected

suddenly my radio elements stopped working, I back to the CakePHP official documentation to double-check the implementation of the radio buttons, and I cannot find what I did wrong. This is my code (I ...
R0bertinski's user avatar

1
2 3 4 5
634