Hello everyone, I am a beginner of flarum, I have encountered a very common problem, but I don't seem to know how to solve this problem, I want to ask everyone for help.
test environment is:
apache+php7.1
My online environment is:
nginx+php7.1
I installed flarum offline and it works, I uploaded it to github, below is my .gitignore
`.idea/
vendor/
config_debug.php`
I am running git clone my-project online.
Then install all extensions via composer install
I set it up chmod -R 777 my-project
I am not sure if it is an environmental problem with nginx and apache.
Below is my nginx config:
`server {
listen 80;
listen [::]:80;
root /var/www/my-product;
index index.php index.html index.htm;
server_name www.xxx.org;
location / { try_files $uri $uri/ /index.php?$query_string; }
location /api { try_files $uri $uri/ /api.php?$query_string; }
location /admin { try_files $uri $uri/ /admin.php?$query_string; }
location ~* ^/(composer\.(json|lock)|config\.php|flarum|storage|vendor) {
deny all;
return 404;
}
location ~* \.php$ {
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
}
location ~* \.html$ {
expires -1;
}
location ~* \.(css|js|gif|jpe?g|png)$ {
expires 1M;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types application/atom+xml
application/javascript
application/json
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
#text/html -- text/html is gzipped by default by nginx
text/plain
text/xml;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
}
`
Below is my config file:
<?php
$config = array (
'debug' => false,
'database' => array (
'driver' => 'mysql',
'host' => 'ip',
'database' => 'forum_fanmily',
'username' => 'root',
'password' => 'password',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'port' => '3306',
'strict' => false,
),
'url' => 'http://online.com',
'paths' => array (
'api' => 'api',
'admin' => 'admin',
),
);
I can access the home page directly or a certain url is OK, but I will get an error when I click through the page mouse.
I am not sure if it is a cache issue, or I have a problem with my configuration.
This makes me very upset. I am a beginner from China and I especially hope to get everyone's help.