assets模块不存在,

后台目录模块不存在等错误都是nginx的配置问题所致,请参考以下配置信息。

 

我的环境:php7.4,容器方式各自运行php和nginx

server {
       listen 80;
       root nginx容器下的目录;


       index index.php index.html index.htm index.nginx-debian.html;

       server_name www.xxx.com;

       location / {
               if (!-e $request_filename) {
                       rewrite  ^/(.*)$  /index.php?s=/$1  last;
                       break;
               }
       }


       location = /favicon.ico { access_log off; log_not_found off; }
       location = /robots.txt  { access_log off; log_not_found off; }

       location ~ \.php(.*)$ {
           fastcgi_pass   php容器或127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;
           fastcgi_param  SCRIPT_FILENAME  php容器下的目录$fastcgi_script_name;
           fastcgi_param PATH_INFO $fastcgi_path_info;
           include        fastcgi_params;
       }

       location ~ /\.ht {
              deny all;
       }
}

如果,提示是thinkphp等文件不存在等错误:

一般是没有在服务器上运行composer update或install,导致目录中不存在thinkphp和vendor

如果是容器运行php,不方便运行composer,可以修改.gitignore文件中,注释掉thinkphp和vender,使这两个目录在git上也同步。

#/thinkphp/

#/vendor/

 

如果,还是有后台的ui异常,不能点击菜单等问题,一般也是gitignore文件中以下目录排除所致,与上一步一样把这些目录注释掉,使其同步。

# /addons/*

# /public/assets/libs/

# /public/assets/addons/*

 

最后在服务器上拉取所有文件即可正常运行fastadmin后台。