## 說明
如果你非常熟悉服務器部署,可以參數以下的配置部署項目。注意,Windows與Linux、MacOS的文件目錄符號不一樣。Window為"\\",Linux和MacOS為"/"。
<br>
## 目錄權限
在linux環境下,要給server/runtime目錄和server/public/uploads目錄777權限。
<br>
## 服務器配置文件
入口文件:
php入口文件為項目根目錄下:likeshop_b2b2c/server/public/index.php
<br>Nginx配置:
```
server {
listen 80;
server_name www.likeshopb2b2c.localhost;
access_log /logs/www.likeshopb2b2c.localhost_access_nginx.log;
error_log /logs/www.likeshopb2b2c.localhost_error_nginx.log;
client_max_body_size 5M;
location / {
root likeshop_b2b2c/server/public;#入口文件目錄
index index.html index.htm index.php;
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ /.*\.php/ {
rewrite ^(.*?/?)(.*\.php)(.*)$ /$2?s=$3 last;
break;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/www/html;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME likeshop_b2b2c/server/public$fastcgi_script_name; #入口文件目錄
include fastcgi_params;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
}
```
<br>或Apache配置
```
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
```