2

After I installed the Flarum, and then access the index.php,

qa.demo.xyz/index.php

there is 404 error in browser's network, and in the browser page there shows:

Cannot GET http://qa.demo.xyz/index.php 

and in there I get the error in the error.log:

2018/08/30 19:39:24 [error] 8960#8960: *57927 FastCGI sent in stderr: "Unable to open primary script: /data/ldl/repo/flarum/index.php (No such file or directory)" while reading response header from upstream, client: 202.82.11.68, server: forum.demo.xyz, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "qa.demo.xyz"

in the directory:

# ls
admin.php  api.php  assets  composer.json  composer.lock  config.php  CONTRIBUTING.md  extensions  flarum  index01.php  index.php  LICENSE  readme.md  scripts  storage  Vagrantfile  vendor

I created a index01.php in there, but I can access it success.


I cat the index.php there get the code:

<?php

/*
 * This file is part of Flarum.
 *
 * (c) Toby Zerner <toby.zerner@gmail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

require 'vendor/autoload.php';

$server = new Flarum\Forum\Server(__DIR__);

$server->listen();

EDIT-01

# ls -al
Total 220
drwxr-xr-x.  7 root  root    4096 8月  30 19:51 .
drwxr-x-wx.  6 nginx nginx     74 8月  30 19:15 ..
-rw-r--r--.  1 root  root     319 11月  3 2015 admin.php
-rw-r--r--.  1 root  root     317 11月  3 2015 api.php
drwxrwxrwx.  4 root  root      32 8月  30 19:52 assets
-rw-r--r--.  1 root  root    1533 11月  3 2015 composer.json
-rw-r--r--.  1 root  root  153178 11月 13 2015 composer.lock
-rw-r--r--.  1 root  root     440 8月  30 19:51 config.php
-rw-r--r--.  1 root  root    4958 11月  3 2015 CONTRIBUTING.md
drwxrwxrwx. 20 root  root    4096 11月 13 2015 extensions
-rw-r--r--.  1 root  root     381 11月  3 2015 flarum
-rw-r--r--.  1 root  root      40 8月  30 19:16 index01.php
-rw-r--r--.  1 root  root     319 11月  3 2015 index.php
-rw-r--r--.  1 root  root    1083 11月  3 2015 LICENSE
-rw-r--r--.  1 root  root    1480 11月  3 2015 readme.md
drwxr-xr-x.  2 root  root      56 11月  3 2015 scripts
drwxrwxrwx.  8 root  root      78 11月  3 2015 storage
-rw-r--r--.  1 root  root   11140 11月  3 2015 Vagrantfile
drwxr-xr-x. 29 root  root    4096 11月 13 2015 vendor

EDIT-02

I changed the index.php to:

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

require __DIR__.'/vendor/autoload.php';

$server = new Flarum\Forum\Server(__DIR__);

$server->listen();

but it still this issue.

qg_java_17137
  • 3,310
  • 10
  • 41
  • 84

1 Answers1

0

It likes you are not in root dir for server. Try

require __DIR__ . '/vendor/autoload.php';