Comments (6)
Which php binary do you use? Check the output of php -v
. You should see
[wanwizard@alfred] $ php -v
PHP 8.2.5 (cli) (built: Apr 11 2023 16:16:23) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.2.5, Copyright (c) Zend Technologies
with Zend OPcache v8.2.5, Copyright (c), by Zend Technologies
with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans
indicating the cli binary is used.
from core.
p.s. changing \Fuel::$is_cli
doesn't magically enable CLI, it is a 'read-only' variable indicating whether or not you are runing in CLI mode.
You should not run tasks from a web request, which I suspect is what you are doing, they have not been designed to work that way.
If you insist, you can work around this issue by adding this to your code:
if(!defined('STDIN')) define('STDIN', fopen('php://stdin', 'rb'));
if(!defined('STDOUT')) define('STDOUT', fopen('php://stdout', 'wb'));
if(!defined('STDERR')) define('STDERR', fopen('php://stderr', 'wb'));
from core.
The STDOUT and STDERR constants are only defined in the cli version of php, the Cli class is not meant to be used bu the cgi version.
How are you using this exactly?
from core.
I am using FuelPHP 1.9/dev in
PHP 8.0.27, FPM/FastCGI mode.
The STDOUT and STDERR constants are only defined in the cli version of php, the Cli class is not meant to be used bu the cgi version.
↑
I APOLOGIZE for the IGNORANCE.
from core.
In the function in MODEL or CONTROLLER,
When RUNNING TASKS,
I TOGGLED cli mode BETWEEN FALSE and TRUE.
// Loading oil Package
\Package::load('oil');
// Environment Setting
// Assign DEFAULT cli mode flag to $bf
$bf = \Fuel::$is_cli;
// TOGGLE cli mode TRUE
\Fuel::$is_cli = true;
// Define Count of Arguments
$_SERVER['argc'] = 1;
// Run Task
// FORMAT: \Oil\Refine::run('[TASK File Name]:[Function]', array([Arguments]));
\Oil\Refine::run('hoge:fuga', array($arg));
// TOGGLE cli mode DEFAULT(= FALSE)
\Fuel::$is_cli = $bf;
For your reference(JAPANESE SITE,CAUTION!),
↓
https://qiita.com/goosys/items/d9dff999db4239f75dc1
from core.
Which php binary do you use? Check the output of
php -v
. You should see[wanwizard@alfred] $ php -v PHP 8.2.5 (cli) (built: Apr 11 2023 16:16:23) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.2.5, Copyright (c) Zend Technologies with Zend OPcache v8.2.5, Copyright (c), by Zend Technologies with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans
indicating the cli binary is used.
My ENVIRONMENT IS
$ php -v
PHP 8.0.27 (cli) (built: Jan 3 2023 16:17:26) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.27, Copyright (c) Zend Technologies
with Zend OPcache v8.0.27, Copyright (c), by Zend Technologies
p.s. changing \Fuel::$is_cli doesn't magically enable CLI, it is a 'read-only' variable indicating whether or not you are runing in CLI mode.
You should not run tasks from a web request, which I suspect is what you are doing, they have not been designed to work that way.
THANK YOU FOR YOUR ADVICE.
from core.
Related Issues (20)
- PhpMarkdown dependencie issue on PHP 7.4.4 HOT 2
- v1.8.2 caused package/config/routes.php to stop registering with the router automatically HOT 9
- \Cache::delete_all() using memcached driver not clearing all items HOT 8
- In SecurityException, set_token is always called with true. HOT 5
- Issue with Request_Curl HOT 3
- like fuel HOT 3
- Soap Trace Options HOT 1
- How do you guys do php8 compatibility checks ? HOT 2
- update PDO methods pls HOT 1
- How do I update my markdown class HOT 3
- bug php 8 HOT 1
- URI path present in _GET / Input::get() in case of PHP7+fpm HOT 6
- setcookie(): Passing null to parameter #5 ($domain) of type string is deprecated PHP 8.1 HOT 1
- strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in PHP 8.1
- PHP 8.1 - Automatic conversion of false to array is deprecated in COREPATH/classes/config/file.php on line 105
- Any plan to make a new release? HOT 11
- Profiler options HOT 1
- ORM count() returns incorrect row number HOT 9
- composite primary keys in CRUD HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.