windows下面apache結合laravel會出現env文件公用的問題,太麻煩,就換用nginx。問題:https://github.com/vlucas/phpdotenv/issues/219php
1.我直接下載openresty的windows版本,啓動html
2.進入到php目錄:php-cgi.exe -b 127.0.0.1:9000nginx
3.openresty的conf文件夾,nginx.conf文件增長include vhosts/*.conf ,vhosts文件配置以下:laravel
server { listen 80; server_name ac1.api.axd.com; root D:\webservice\php\gitlab.aixiangdao.com\ac1.api\public; index index.html index.htm index.php; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; charset utf-8; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } #error_page 404 /index.php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; #fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.(?!well-known).* { deny all; } }