私は最終的にそれが動作するようにし、私は、仮想マシン上でそれをテストして:
nginxのバージョン:nginxの/ 1.10.0 14.14按分5.7.18版 PHP 7.1.6 MySQLの nginxのデフォルトのファイルに
私はこれを追加します。
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location /dataroot/ {
internal;
alias /var/www/moodledata/; # ensure the path ends with/
}
気分のconfig.phpファイルにル私はこれを追加しました:
$CFG->xsendfile = 'X-Accel-Redirect';
$CFG->xsendfilealiases = array(
'/dataroot/' => $CFG->dataroot
);
これは私のデフォルトのnginxのファイルがどのように見えるかです:
サーバーブロック:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
}
location /dataroot/ {
internal;
alias /var/www/moodledata/; # ensure the path ends with/
}
try_files $uri $uri/ /index.php?args;
}
そして、これは、Moodleのconfig.phpファイルです:
<?php
unset($CFG); // Ignore this line
global $CFG; // This is necessary here for PHPUnit execution
$CFG = new stdClass();
$CFG->dbtype = 'mysqli';
$CFG->dblibrary = 'native';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'dbusername';
$CFG->dbpass = 'dbpassword';
$CFG->prefix = 'mdl_';
$CFG->dboptions = array(
'dbpersist' => 0,
'dbsocket' => '',
'dbport' => 3306,
'dbhandlesoptions' => false,
'dbcollation' => 'utf8mb4_general_ci',
);
$CFG->wwwroot = 'http://localhost/moodle';
$CFG->dataroot = '/var/www/moodledata';
$CFG->directorypermissions = 0777;
$CFG->admin = 'admin';
$CFG->xsendfile = 'X-Accel-Redirect';
$CFG->xsendfilealiases = array(
'/dataroot/' => $CFG->dataroot
);
require_once(__DIR__ . '/lib/setup.php'); // Do not edit
私はphp.iniファイルを変更しませんでした。またはPHPのwww.conf。
sudo apt-get install php7.1-fpm php7.1-mysql php7.1-common php7.1-cgi php7.1-curl php7.1-cli php7.1-dev php7.1-gd php7.1-gmp php7.1-xml php7.1-xmlrpc php7.1-zip php7.1-xls php7.1-opcache php7.1-mbstring php7.1-soap php7.1-intl graphviz aspell php7.1-pspell php7.1-ldap
:私はこれらのモジュールをインストールするにはお勧めしないPHPをインストールすると
https://docs.moodle.org/33/en/Nginx#XSendfile_aka_X-Accel-Redirect
:nginxのとmoodles config.phpファイルを構成するには
:ここ
は私が情報を得たページです
遅れて申し訳ありませんが、私はそれを試みましたが、うまくいきませんでした。私は他の投稿でそれを見ました。 –