I’m trying to understand how this module works in order to get it to work. If I had a better understanding of auto-loading and the inner workings of Yii, I could solve this myself.
I have it configured according to the instructions:
'modules' => [
'cms'=>[
'class'=> amintado\wordpress\Module::className(),
]
]
Then I’m instructed to open this link in order to install Wordpress: http://yourhost.com/frontend/index.php/cms.
Since I’ve removed index.php, I’m accessing it with this link: http://yourhost.com/cms/
Note that the trailing slash is needed (is this correct?). Then it runs the default controller of the module, which creates /cms in the root directory (i.e. outside of the web folder) and copies Wordpress to it. Then it runs wp-load.php with this line:
include (__DIR__.'/../../../../cms/wp-load.php');
This is the wp-load file in cms, not in the vendor directory. So far so good, until it comes to line 202 of wp-load, which attempts to redirect to /cms/wp-admin/setup-config.
if ( false === strpos( $_SERVER['REQUEST_URI'], 'setup-config' ) ) {
header( 'Location: ' . $path ); // $path = 'https://myhost/cms/wp-admin/setup-config.php
exit;
}
But this just returns a 404 not found error. And in fact anything I try to access in /cms/ returns the same error.
My question right now is, how is the module attempting to redirect to a script outside the web folder and why isn’t it working?
httpdocs
[indent]|----backend[/indent]
[indent]|----cms[/indent]
[indent][indent]|----wp-load.php[/indent][/indent]
[indent][indent]|----wp-admin[/indent][/indent]
[indent][indent][indent]|----setup-config.php[/indent][/indent][/indent]
[indent][indent]|----wp-content[/indent][/indent]
[indent][indent]|----wp-includes[/indent][/indent]
[indent][indent]|----yii-config[/indent][/indent]
[indent]|----common[/indent]
[indent]|----frontend[/indent]