Open VovaSlipchenko opened 1 year ago
To install phalcon use pecl, to install for diferent versions you need the dev package for that php version, i.e. php8.2-dev. to run pecl for each php version you probably have to go directly to the pecl binary of each version.
Phalcon is already on 5.3 version.
Check if APCU is active in cli/php.ini
To install phalcon use pecl, to install for diferent versions you need the dev package for that php version, i.e. php8.2-dev. to run pecl for each php version you probably have to go directly to the pecl binary of each version.
Phalcon is already on 5.3 version.
Check if APCU is active in cli/php.ini
Hello rudiservo, problem is that when i solve problem with APCU (switch to Memory), i got next error, when i solve this error - i get next. Like all phalcon is broken.
The error of APCU in php cli is that APCU might not be enabled in CLI php.ini or miss configured
Try updating Phalcon to the latest version and check again.
Hi, i tried to make assembly on Ubuntu 22, with Phalcon 5.3.0 + PHP 8.1, i have no more cache problem, but i still have this problem:
It says class Task is not found Class tasks placed in app->tasks->system->Task.php defined as:
<?php
namespace MyApp\Tasks\System;
use ...
abstract class Task{
...
}
used as parent class for other tasks instances:
<?php
namespace MyApp\Tasks;
...
use MyApp\Tasks\System\Task;
...
class TaskCompileTag extends Task{
in autoloader i define:
protected function registerAutoloaders()
{
$loader = new Loader();
$loader->setDirectories([
APP_PATH . '/controllers/',
APP_PATH . '/models/',
APP_PATH . '/tasks/system/',
APP_PATH . '/tasks/',
]);
$loader->register();
}
this works perfect on Windows, but all my attempts to run script on linux are failed. I always tested all of my Phalcon projects on windows environment and never had problems with migration to Linux server
@VovaSlipchenko, ok, my guess is that you forgot that linux is Case Sensitive. The file or folder must be in lower case or upper case, it could also be the case the loader is not well configured.
My advice is always develop in the environment closer to production. Use docker, in windows you got Linux Subsystem.
@rudiservo Yes, thank you for reminding about case sensitivity. But same file worked well on linux with Phalcon 3+ problem appeared after upgrade to Phalcon 5+
the path of Task class file is /app/tasks/system/Task.php
same as model or controller, like /app/models/SomeTable.php
I tryed to put file Task.php to folder /app/tasks (same folder with child class = TaskCompoleTag, where i have a problem "Class Task not found") And it works!
Have you tried to register the complete namespace, MyApp\Tasks\System?
@VovaSlipchenko Is this still an problem? If not I will close the issue.
When i execute: apt install php8.1-phalcon5
It looks like you're installing phalcon via the sury package repository.
It install php 8.2 and switch php version to 8.2, where phalcon is not presented
This means you have some mixed packages or some virtual packages, that automatically install multiple version of PHP linked to this package.
If you want to specifically use php8.1 you could run:
sudo update-alternatives --set php /usr/bin/php8.1
Else you have to install all required packages to the php8.2 version too, like @rudiservo mentioned.
To check some package differences, you could compare the outputs and install missing packages:
dpkg -l | grep -e '^ii' | grep php8.1
dpkg -l | grep -e '^ii' | grep php8.2
Good day, i faced the following problem: I have my phalcon project running on windows: PHP 8.1.6 Phalcon 5.2.1
Everything works good!
But, when im trying to make some linux setup, like this: Ubuntu 20.04.6 LTS PHP 8.1.22 Phalcon 5.1.2
php -m [PHP Modules]
i got the following error in one of scripts (it's a CLI service to execute tasks from queue) i start script with command: php app/tasks.php
And get this exception:
Event i change cache provider from Apcu to Memory - i got new error, like “Autoloader can't find some class” - but this class exists in the folder and i added this folder to autoloader. It works like phalcon is broken
Also, have strange moment: When i execute: apt install php8.1-phalcon5 It install php 8.2 and switch php version to 8.2, where phalcon is not presented
Code of tasks.php file:
Code of Options model: