Thankphp Project general deployment in lamp under General no problem, deployment in LNMP is a bit acclimatized,,, 404, ajax err,,, God horse
You need to modify the configuration of the Nginx:
#方法一:[email protected]:/etc/nginx/sites-enabled$ sudo cat default [sudo] password for kkk: server { listen 80 default_server; root /data/www/t1; index index.php index.html index.htm; server_name localhost; location / { # try_files $uri /index.php$url; if (!-e $request _filename) { rewrite ^/(. *) $ /index.php/$1 last; break; } } location ~ \.php/?. *$ { #root /var/www/html/website; fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php; #加载Nginx默认 "Server environment variables" configuration include fastcgi.conf; #设置PATH_INFO并改写SCRIPT_FILENAME, script_name server environment variables set $fastcgi _script_name2 $fastcgi _script_name; if ($fastcgi _script_name ~ "^ (. +\.php) (/.+) $") { set $fastcgi _script_name2 $1 ; set $path _info $2; } fastcgi_param PATH_INFO $path _info; fastcgi_param SCRIPT_FILENAME $document _root$ fastcgi_script_name2; fastcgi_param SCRIPT_NAME $fastcgi _script_name2; } }#----------------------------------------------------------------------------------#方法二:[email Protected]:/etc/nginx/sites-enabled$ cat default server { listen 80 default_server; root /data/www/t1; index index.php index.html index.htm; server_name localhost; Location / { index index.htm index.html index.php; # The file that accesses the path does not exist and the rewrite URL is forwarded to thinkphp processing try_files $uri /index.php$uri; } location ~ .+\.php ($|/) { #root /var/www/html/website; fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php; #设置PATH_INFO, note that Fastcgi_split_path_info has automatically rewritten the fastcgi_script_name variable, #后面不需要再改写SCRIPT_FILENAME, script_name environment variable, so you must set it before loading fastcgi.conf fastcgi_split_path_info ^ (. +\.php) (/.*) $; fastcgi_param path_info $fastcgi _path_info; #加载Nginx默认 "Server environment variables" configuration include fastcgi.conf; } }[email protected]:/etc/nginx/sites-enabled$
Thankphp project is deployed under Nginx