0

私はこの問題の原因を突き止め、誰かが私に正しい方向を向けることを願っています。WordPress ENV/WP_HOME/WP_SITE_URL

いくつかの部分は、根に基づいていますが、私は彼らと比べて何の答えも見つけられないようです。ここで

は、ファイル構造である - >http://imgur.com/a/W2eYY

上に行くように見える私はWordPressのインストール/セットアップを通過し、URLにこれを入力するために行くときである(フレームワーク()DEV /公共/ WP。 /)それはDEV/WP/WP-管理/ install.phpを)

キー

(。)=(ちょうどそれが(フレームワーク(。に行くようにするどのような方法がある)http://framework.dev/public/wp/framework.dev/wp/wp-admin/install.php)これに自分自身を変更します。

BB_USER=BBUSERNAME 

DB_NAME=framework 
DB_USER=root 
DB_PASSWORD=root 

DB_HOST=localhost 
DB_PREFIX=wp_ 

WP_ENV=Development 
WP_HOME=framework.dev 
WP_SITEURL=${WP_HOME}/wp 

composer.json:

{ 
    "name": "framework/framework", 
    "description": "Modern WordPress Framework", 
    "type": "wordpress-core", 
    "authors": [ 
     { 
      "name": "Name", 
      "email": "[email protected]" 
     } 
    ], 
    "config": { 
     "preferred-install": "dist" 
    }, 
    "repositories":[ 
     { 
      "type":"composer", 
      "url":"https://wpackagist.org" 
     } 
    ], 
    "scripts": { 
     "post-install-cmd": [ 
      "cp -r public/wp/wp-content public/app" 
     ] 
    }, 
    "require": { 
     "php": ">=5.6", 
     "composer/installers": "1.3.0", 
     "johnpbloch/wordpress": "4.8.0", 
     "roots/wp-password-bcrypt": "1.0.0", 
     "timber/timber": "1.3.2", 
     "roots/soil": "3.7.2", 
     "mnsami/composer-custom-directory-installer": "1.1.1", 
     "vlucas/phpdotenv": "2.4.0", 
     "oscarotero/env": "^1.0" 
    }, 
    "require-dev": { 
     "squizlabs/php_codesniffer": "^2.5.1" 
    }, 
    "extra": { 
     "installer-paths": { 
     "public/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"], 
     "public/app/plugins/{$name}/": ["type:wordpress-plugin"], 
     "public/app/themes/{$name}/": ["type:wordpress-theme"] 
    }, 
     "wordpress-install-dir": "public/wp" 
} 
} 

のconfig/application.php

は私が2つの以上のリンク

.envファイルを投稿させません

<?php 
/** @var string Directory containing all of the site's files */ 
$root_dir = dirname(__DIR__); 
/** @var string Document Root */ 
$webroot_dir = $root_dir . '/public'; 

/* 
|------------------------------------------------------------------ 
| Expose global ENV 
|------------------------------------------------------------------ 
| 
| Expose global env() function from oscarotero/env 
| 
*/ 

Env::init(); 

/* 
|------------------------------------------------------------------ 
| Dotenv Settings 
|------------------------------------------------------------------ 
| 
| Use Dotenv to set required environment variables and load .env file in root 
| 
*/ 

$dotenv = new Dotenv\Dotenv($root_dir); 
if (file_exists($root_dir . '/.env')) { 
    $dotenv->load(); 
    $dotenv->required(['DB_NAME', 'DB_USER', 'DB_PASSWORD', 'WP_HOME', 'WP_SITEURL']); 
} 

/* 
|------------------------------------------------------------------ 
| ENV Settings 
|------------------------------------------------------------------ 
| 
| Set up our global environment constant and load its config first 
| Default: Development 
| 
*/ 

define('WP_ENV', env('WP_ENV') ?: 'production'); 
$env_config = __DIR__ . '/environments/' . WP_ENV . '.php'; 
if (file_exists($env_config)) { 
    require_once $env_config; 
} 

/* 
|------------------------------------------------------------------ 
| URL 
|------------------------------------------------------------------ 
| 
| Env's for the URL 
| 
*/ 

define('WP_HOME', env('WP_HOME')); 
define('WP_SITEURL', env('WP_SITEURL')); 

/* 
|------------------------------------------------------------------ 
| Custom Content Directory 
|------------------------------------------------------------------ 
| 
| Changes where the content is stored. 
| 
*/ 

define('CONTENT_DIR', '/app'); 
define('WP_CONTENT_DIR', $webroot_dir . CONTENT_DIR); 
define('WP_CONTENT_URL', WP_HOME . CONTENT_DIR); 

/* 
|------------------------------------------------------------------ 
| DB Settings 
|------------------------------------------------------------------ 
| 
| Uses ENV to populate the correct DB settings. 
| 
*/ 

define('DB_NAME', env('DB_NAME')); 
define('DB_USER', env('DB_USER')); 
define('DB_PASSWORD', env('DB_PASSWORD')); 
define('DB_HOST', env('DB_HOST')); 
define('DB_CHARSET', 'utf8mb4'); 
define('DB_COLLATE', ''); 
$table_prefix = env('DB_PREFIX'); 

/* 
|------------------------------------------------------------------ 
| Authentication Unique Keys and Salts 
|------------------------------------------------------------------ 
| 
| Automatically Generated by the init setup command 
| 
*/ 

define('AUTH_KEY',   'put your unique phrase here'); 
define('SECURE_AUTH_KEY', 'put your unique phrase here'); 
define('LOGGED_IN_KEY', 'put your unique phrase here'); 
define('NONCE_KEY',  'put your unique phrase here'); 
define('AUTH_SALT',  'put your unique phrase here'); 
define('SECURE_AUTH_SALT', 'put your unique phrase here'); 
define('LOGGED_IN_SALT', 'put your unique phrase here'); 
define('NONCE_SALT',  'put your unique phrase here'); 

/* 
|------------------------------------------------------------------ 
| Custom Settings 
|------------------------------------------------------------------ 
| 
| Custom Global Settings that won't be affected by the ENV 
| 
*/ 

define('AUTOMATIC_UPDATER_DISABLED', true); 
define('DISABLE_WP_CRON', env('DISABLE_WP_CRON') ?: false); 
define('DISALLOW_FILE_EDIT', true); 
define ('WPLANG', 'en_GB'); 

/* 
|------------------------------------------------------------------ 
| Roots/soil Settings 
|------------------------------------------------------------------ 
| 
| Include any number of roots/soil options here 
| 
*/ 

// add_theme_support('soil-clean-up'); 
// add_theme_support('soil-disable-trackbacks'); 
// add_theme_support('soil-relative-urls'); 

/* 
|------------------------------------------------------------------ 
| Bootstrap WordPress 
|------------------------------------------------------------------ 
| 
| Bootstrap WordPress 
| 
*/ 

if (!defined('ABSPATH')) { 
    define('ABSPATH', $webroot_dir . '/wp/'); 
} 

公共/ index.phpを

<?php 
define('WP_USE_THEMES', true); 
require(dirname(__FILE__) . '/wp/wp-blog-header.php'); 

公共/ WP-config.phpを

<?php 
require_once(dirname(__DIR__) . '/vendor/autoload.php'); 
require_once(dirname(__DIR__) . '/config/application.php'); 
require_once(ABSPATH . 'wp-settings.php'); 

のwp-cli.yml

path: public/wp 

答えて

0

これは動作するようです。

WP_HOME=http://example.dev/public 
WP_SITEURL=${WP_HOME}/wp/ 
0

追加ます。http:あなたのWP_HOMEに// env変数。

+0

ありがとう、これは私に答えを得るのを助けた。 –

+0

笑これはまさに答えはありませんか? – TurtleTread

+1

はい、最後に/ publicを部分的に追加すると、ファイルのリンクがソートされました。 –