yii2-podium icon indicating copy to clipboard operation
yii2-podium copied to clipboard

There was a major error during installation!

Open elkrari opened this issue 7 years ago • 16 comments

The error below appears instantly after clicking on "Start Podium installation". Yii 2.012 and PHP 7.0.15

----------------------------------ERROR MESSAGE----------------------------------------- There was a major error during installation! Check your runtime log for details.

--------------------------------------------LOG------------------------------------------------- POST http://localhost/myapp/podium/install/import at 2017-06-08 02:03:16 pm by 127.0.0.1

error yii\web\HttpException:404 yii\web\NotFoundHttpException: Page not found. in /var/www/html/myapp/vendor/yiisoft/yii2/web/Request.php:195 Stack trace: #0 /var/www/html/myapp/vendor/yiisoft/yii2/web/Application.php(82): yii\web\Request->resolve() #1 /var/www/html/myapp/vendor/yiisoft/yii2/base/Application.php(380): yii\web\Application->handleRequest(Object(yii\web\Request)) #2 /var/www/html/myapp/index.php(11): yii\base\Application->run() #3 {main}

elkrari avatar Jun 08 '17 14:06 elkrari

Does this error pop at the start of installation? Can you show me your config for Podium and for UrlManager?

bizley avatar Jun 08 '17 16:06 bizley

Yes, instantly after clicking on "Start Podium installation".

Below the configs... ---------Podium Config--------- 'podium' => [ 'class' => 'bizley\podium\Podium', 'userComponent' => 'user', 'adminId' => 1, ], ---------User Component--------- 'user' => [ 'identityClass' => 'app\models\User', //'enableAutoLogin' => true, 'absoluteAuthTimeout' => 86400, ],

---------Url Manager--------- 'urlManager' => [ 'class' => 'yii\web\UrlManager', 'showScriptName' => false, 'enablePrettyUrl' => true, 'enableStrictParsing' => true, 'rules' => [ /* I have many customized rules */ ], ],

elkrari avatar Jun 08 '17 16:06 elkrari

Actually I'm hoping for this /* I have many customized rules */ part. I'm guessing there might be one of them causing error.

bizley avatar Jun 08 '17 17:06 bizley

These are the complete rules (some of them are commented):

'rules' => [ '/' => 'site/index', 'login/?' => 'site/login', 'logout/?' => 'site/logout', 'faq/?' => 'site/faq', 'terms/?' => 'site/terms', 'privacy/?' => 'site/privacy', 'account/?' => 'user/view', 'links/?'=>'page/index', 'ptcads/?'=>'advertisement/index', 'fixedads/?'=>'advertisement/fixedads', 'viewads/?'=>'advertisement/viewads', //'cookad/?'=>'advertisement/cookad',

		        'visit/<ad:\d+>'=>'advertisement/visit',
		        
		        'payment/?<pay:\w*>'=>'user-ecurrency/payment',
		        'executepayment/?'=>'user-ecurrency/executepayment',
		        'cancelpay' => 'user-ecurrency/cancelpay',
		        'deposit' => 'user-ecurrency/deposit',
		        'withdraw' => 'user-ecurrency/withdraw',
				
		        'memberships/?'=>'membership/index',
		        'campaign/?' => 'campaign/index',
		        'clicks/?' => 'clicks/index',
		        'refsflow/?'=>'pack/index',
		        'fundsflow/?'=>'withdrawal/index',
		        'proofs/?'=>'withdrawal/proofs',
		        
				// 'forum/<controller:\w+>/<action:[\w-]+>'=> 'forum/<controller>/<action>',
				// 'forum/<controller:\w+>'=> 'forum/<controller>',
				// 'forum/?' => 'forum',
				'elkrari/?' => 'elkrari',

		        // 'register' => 'site/register',
		        //'<id:\w+>' => 'user/view'
		        '<action:\w+>' => 'user/<action>',
		        '<controller:\w+>/<action:\w+>/' => '<controller>/<action>',
		        '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
		        
		        //'request-password-reset' => 'site/request-password-reset',
		        //'reset-password' => 'site/reset-password',
		    ],

elkrari avatar Jun 08 '17 17:06 elkrari

It's because of this line:

'<controller:\w+>/<action:\w+>/' => '<controller>/<action>',

When you remove it it works fine. Or you can enter installation screen with route /podium/install/run.

I must modify Podium routing to prevent this error.

bizley avatar Jun 08 '17 17:06 bizley

The route /podium/install/run doesn't work...

Should I comment this rule line to process to installation? The forum will work if I uncomment it later?

elkrari avatar Jun 08 '17 17:06 elkrari

Oh, this is surprise. I've just made clean installation of basic app 2.0.12 with Podium and it was fine. Are any other addresses like /site/contact working for you? How is your virtual host set?

bizley avatar Jun 08 '17 18:06 bizley

Yes http://localhost/myapp/site/contact is working

My app is under apache2, which kind of details do you need to know about it?

elkrari avatar Jun 08 '17 18:06 elkrari

Virtual host setup, either in Apache configuration or .htaccess file.

bizley avatar Jun 08 '17 18:06 bizley

apache2_conf.txt

.htaccess file:

Options -Indexes

RewriteRule ^([^/]+)/?$ $1


Options +FollowSymLinks
IndexIgnore */*

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

elkrari avatar Jun 08 '17 18:06 elkrari

Does the first RewriteRule work at all? Anyway, it looks good in general and I'm not sure why http://localhost/myapp/podium/install/run doesn't work for you. Maybe try again without the previously mentioned UrlManager rule.

bizley avatar Jun 08 '17 19:06 bizley

Yes, the first rule works. My App is working since many years.

I removed the previously mentioned UrlManager rule, got the same errors, even after removing the three rules

'<action:\w+>' => 'user/<action>',
'<controller:\w+>/<action:\w+>/' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

elkrari avatar Jun 08 '17 22:06 elkrari

Can I see your whole config file? Remember to remove personal data.

bizley avatar Jun 09 '17 05:06 bizley

console_php.txt web_php.txt

Find attached config files...

elkrari avatar Jun 09 '17 19:06 elkrari

'enableStrictParsing' => true, is the reason. I must fix this in next release.

bizley avatar Jun 09 '17 19:06 bizley

OK, now the forum has been installed! Hope that this parameter will not impact my App.

elkrari avatar Jun 09 '17 21:06 elkrari