-
I am in progress of upgrading from Phalcon 3.4.2 to 4.0.1. I went through Upgrade Guideline and made changes accordingly to it. Application itself is running, I can see that all services are running and controller is called but when I'm trying to get something from the database, application fails and doesn't send any response. It fails absolutely silently, there are no errors in apache logs. When I build the query in my model it works but it stops working right after calling
Decomposing the code above I can see that it crashes on execution. It also crashes on calling I checked my DB connection by creating a simple connection in controller and realized that it works fine and returns a resultset. Here you can see how I initialize DB connection to be used by models around the application:
This code does not raise any exceptions too.
I spent 2 days debugging this stuff but it's very hard when Phalcon does not provide any logs or exceptions. Does anyone have an idea what can be wrong or how can I make Phalcon speak? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 31 replies
-
Phalcon's View layer suppresses all output not through the View, so if any error messages get output, they don't get displayed. You could try public static function getById($id) {
$result = self::query()
->where('users_id = :users_id:')
->bind(
[
'users_id' => $id,
])
->execute()
->getFirst();
exit();
} If that doesn't provide any results, you could maybe try logging directly in the database? With that said - database issues rarely cause silent script halting. Also, your method can be rewritten more simply with public static function getById($id) {
return self::findFirst(['users_id = :users_id:','bind'=>['users_id'=>$id]]);
} |
Beta Was this translation helpful? Give feedback.
-
Try public static function getById($id) { This should work. |
Beta Was this translation helpful? Give feedback.
-
This problem is not resolved yet. Does anyone have any ideas? Please, help! |
Beta Was this translation helpful? Give feedback.
-
Your errors might be disabled in your environment. Try to wrap with try catch inside
|
Beta Was this translation helpful? Give feedback.
-
Please show output of |
Beta Was this translation helpful? Give feedback.
-
I compiled 4.1.0 from the source code and the problem was resolved. Seems like the problem was with debian package for Ubuntu. |
Beta Was this translation helpful? Give feedback.
-
Had the same issue as oslaskyy when using Phalcon ORM with Ubuntu 20.04, PHP 7.4 and Phalcon 4.1.x. This discussion helped figure it out what the problem was. Downgrading to Phalcon 4.0.6 worked fine. Anybody with Ubuntu 20.04 and PHP 7.4 installing Phalcon 4 following the official installation guide will likely be stuck with this problem. The workaround below can help solve it without resorting to compile the sources. Phalcon 4.0.6 for Ubuntu 20.04 (focal) is not available at https://packagecloud.io/phalcon/stable/ubuntu/ but it is there for Ubuntu 18.04 (bionic). Manually edit file /etc/apt/sources.list.d/phalcon_stable.list change these lines: deb https://packagecloud.io/phalcon/stable/ubuntu/ focal main to: deb https://packagecloud.io/phalcon/stable/ubuntu/ bionic main Then install 4.0.6 with: apt-get install php7.4-phalcon=4.0.6-975+php7.4 |
Beta Was this translation helpful? Give feedback.
I compiled 4.1.0 from the source code and the problem was resolved. Seems like the problem was with debian package for Ubuntu.