我在开发laravel框架,在vhosts中定义了路由
server {
listen 8080;
server_name localhost localhost;
root "E:\web\php\TS_PLUS\public";
location / {
try_files $uri $uri/ /index.php?$query_string;
index index.html index.htm index.php;
#autoindex on;
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}加了这行路由代码
try_files $uri $uri/ /index.php?$query_string;
问题是phpstady 每次电脑重新启动的时候这行路由配置没有了。怎么个处理法?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
phpStudy是按照固定格式读取虚拟域名站点的,分别是域名、路径、二级域名、端口,你自己配置的信息,软件是无法识别,适合新手傻瓜式配置站点,弱国熟悉配置Vhost的文件的话,请手动自己配置,不要使用软件即可,因为手动配置不按照固定格式会导致Nginx无法启动。