Ich entwickle das Laravel-Framework und definiere Routing in 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; } }
Ich habe diese Routing-Codezeile hinzugefügt
try_files $uri $uri/ /index.php?$query_string;
Das Problem ist, dass phpstady diese Routing-Konfigurationszeile bei jedem Neustart des Computers verliert. Was ist die Lösung?
phpStudy是按照固定格式读取虚拟域名站点的,分别是域名、路径、二级域名、端口,你自己配置的信息,软件是无法识别,适合新手傻瓜式配置站点,弱国熟悉配置Vhost的文件的话,请手动自己配置,不要使用软件即可,因为手动配置不按照固定格式会导致Nginx无法启动。