E
E
edik892016-11-09 11:45:37
Yii
edik89, 2016-11-09 11:45:37

How to run php yii requirements.php command?

For some reason, the php yii requirements.php command is not executed. Gives an error:
Error: Unknown command "requirements.php".
Created a file test.php with the content:

<?php
echo "Hello";

It works from the console, all console commands through php yii also work. The problem is with php yii requirements.php. Nobody faced?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-11-09
@webinar

Everything doesn't work right. requirements.php is a file, not a command.
Make a console controller, it contains an action and there is already code

namespace app\commands;

use yii\console\Controller;

class HelloController extends Controller
{
public function actionMyaction()
    {
       echo 'hello';
    }
}

run like this:
Details: www.yiiframework.com/doc-2.0/guide-tutorial-consol...
The requirements.php file is made to check the server parameters for compliance with the requirements and works without yii, especially without the console, by the way, the console can contain completely different conditions, no drivers, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question