Replies: 1 comment
-
Thanks for using the extension, do i currently have it working like this with: https://github.com/yiisoft/yii2-app-basic composer.json "minimum-stability": "dev",
"require": {
"php": ">=7.4.0",
"httpsoft/http-message": "^1.1",
"yiisoft/yii2": "~2.0.45",
"yiisoft/yii2-bootstrap5": "~2.0.2",
"yiisoft/yii2-symfonymailer": "~2.0.3",
"yii2-extensions/franken-php": "^0.1@dev",
"yii2-extensions/psr-bridge": "^0.1@dev"
},
"require-dev": {
"codeception/codeception": "^5.0.0 || ^4.0",
"codeception/lib-innerbrowser": "^4.0 || ^3.0 || ^1.1",
"codeception/module-asserts": "^3.0 || ^1.1",
"codeception/module-filesystem": "^3.0 || ^2.0 || ^1.1",
"codeception/module-yii2": "^1.1",
"codeception/verify": "^3.0 || ^2.2",
"yii2-extensions/worker-debug": "^0.1",
"yiisoft/yii2-debug": "~2.1.0",
"yiisoft/yii2-faker": "~2.0.0",
"yiisoft/yii2-gii": "~2.2.0"
}, web/index.php <?php
declare(strict_types=1);
use yii2\extensions\frankenphp\FrankenPHP;
use yii2\extensions\psrbridge\http\StatelessApplication;
// production default (change to 'true' for development)
defined('YII_DEBUG') or define('YII_DEBUG', true);
// production default (change to 'dev' for development)
defined('YII_ENV') or define('YII_ENV', 'dev');
// disable PHP automatic session cookie handling
ini_set('session.use_cookies', '0');
require dirname(__DIR__) . '/vendor/autoload.php';
require dirname(__DIR__) . '/vendor/yiisoft/yii2/Yii.php';
$config = require dirname(__DIR__) . '/config/web.php';
$runner = new FrankenPHP(new StatelessApplication($config));
$runner->run(); Caddyfile
config\web.php <?php
use HttpSoft\Message\{
ResponseFactory,
ServerRequestFactory,
StreamFactory,
UploadedFileFactory,
};
use Psr\Http\Message\{
ResponseFactoryInterface,
ServerRequestFactoryInterface,
StreamFactoryInterface,
UploadedFileFactoryInterface,
};
use yii2\extensions\debug\WorkerDebugModule;
$params = require __DIR__ . '/params.php';
$db = require __DIR__ . '/db.php';
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
'components' => [
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => 'your-secret-key',
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'user' => [
'identityClass' => 'app\models\User',
'enableAutoLogin' => false,
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'mailer' => [
'class' => \yii\symfonymailer\Mailer::class,
'viewPath' => '@app/mail',
// send all mails to a file by default.
'useFileTransport' => true,
],
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'db' => $db,
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
],
],
'container' => [
'definitions' => [
ResponseFactoryInterface::class => ResponseFactory::class,
ServerRequestFactoryInterface::class => ServerRequestFactory::class,
StreamFactoryInterface::class => StreamFactory::class,
UploadedFileFactoryInterface::class => UploadedFileFactory::class
],
],
'params' => $params,
];
if (YII_ENV_DEV) {
// configuration adjustments for 'dev' environment
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => WorkerDebugModule::class,
// uncomment the following to add your IP if you are not connecting from localhost.
'allowedIPs' => ['*'],
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
// uncomment the following to add your IP if you are not connecting from localhost.
//'allowedIPs' => ['127.0.0.1', '::1'],
];
}
return $config; Everything in the franken-php docs: https://github.com/yii2-extensions/franken-php Thanks. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Yii2 version 2.0.53
index.php
Caddyfile :
{
order php_server before file_server
auto_https off
}
:8080 {
root * /var/www/html/sb/api/web
}
run command:
frankenphp run
error:
Beta Was this translation helpful? Give feedback.
All reactions