Replies: 2 comments
-
You can change the default php version as below: About warning "PHP Warning: Use of undefined constant TENANT_PATH", you can comment out or delete where to include |
Beta Was this translation helpful? Give feedback.
-
The issue isn't that |
Beta Was this translation helpful? Give feedback.
-
We are running Phalcon 3.4.5 on php-fpm with PHP 7.3 which is one of multiple concurrent versions of PHPs on the server.
Is it possible to set custom PHP version which is exectued by $console->handle() in cli.php
Default PHP on $PATH is PHP 8.0
$ /usr/bin/php -v
PHP 8.0.25 (cli) (built: Oct 25 2022 09:42:31) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.25, Copyright (c) Zend Technologies
with Zend OPcache v8.0.25, Copyright (c), by Zend Technologies
with Xdebug v3.1.6, Copyright (c) 2002-2022, by Derick Rethans
but one with Phalcon module is, PHP 7.3 on path
$ /usr/local/php-7.3/bin/php -v
PHP 7.3.33 (cli) (built: Jan 10 2022 16:31:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.33, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.33, Copyright (c) 1999-2018, by Zend Technologies
When we process our Cli tasks with $console->handle() it picks wrong version of PHP 8.0 instead of 7.3.
use Phalcon\Cli\Console;
use Phalcon\Cli\Dispatcher;
use Phalcon\Di\FactoryDefault\Cli as FactoryDefault;
$console = new Console();
$console->setDI($di);
$console->handle($arguments);
It is executing
php cli.php tenant vasco syncorder d1bc2d8f-39ea-4072-a967-418f821474f0
but we wont, that $console->handle executes
/usr/local/php-7.3/bin/php cli.php tenant vasco syncorder d1bc2d8f-39ea-4072-a967-418f821474f0
Not working:
$ php cli.php
Working:
$ /usr/local/php-7.3/bin/php cli.php
PHP Warning: Use of undefined constant TENANT_PATH - assumed 'TENANT_PATH' (this will throw an Error in a future version of PHP) in ../application/app/config/config.php on line 24
..
Beta Was this translation helpful? Give feedback.
All reactions