小编Rav*_*ngh的帖子

将PHP文件作为下载提供,而不是执行它们

我最近在我的机器上安装了nginx和php 7.0.16,但由于某种原因,nginx下载了php文件,而不是执行它们.我已经花了几天时间在网上实现了所有可用的解决方案,但都是徒劳的.

我的nginx.conf是:

worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

# Load dynamic modules. See /usr/share/nginx/README.fedora.
include /usr/share/nginx/modules/*.conf;

events {
    worker_connections 1024;
}

http {
    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;
    keepalive_timeout   65;
    types_hash_max_size 2048;

    include             /etc/nginx/mime.types;
    default_type        application/octet-stream;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}
Run Code Online (Sandbox Code Playgroud)

conf.d文件夹中没有文件,启用了网站的文件只有下面的默认文件

server {
    listen 80;
    server_name infrastructure;
    root /home/infra/index;
    index index.php index.html index.htm;
    #return 301 https://$server_name$request_uri;

    location / {
        try_files …
Run Code Online (Sandbox Code Playgroud)

nginx php-7 php-7.1

6
推荐指数
2
解决办法
1万
查看次数

AWS EC2 安装 Chrome 作为用户数据

我正在尝试在用户数据中使用 PowerShell 自动安装 Chrome 以及其他一些任务。但是 Chrome 安装失败,因为它需要处于提升模式的 PowerShell。

以下是我的代码片段:

<powershell>
#Change TimeZone
C:\Windows\System32\tzutil /s "AUS Eastern Standard Time"

#Install Chrome 
$Path = $env:TEMP;
$Installer = "chrome_installer.exe";
Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile     $Path\$Installer; 
Start-Process -FilePath $Path\$Installer -ArgumentList "/silent /install" -Verb RunAs -Wait;
Remove-Item $Path\$Installer

#Set Chrome as default browser
$chromePath = "${Env:ProgramFiles(x86)}\Google\Chrome\Application\" 
$chromeApp = "chrome.exe"
$chromeCommandArgs = "--make-default-browser"
& "$chromePath$chromeApp" $chromeCommandArgs
</powershell>
Run Code Online (Sandbox Code Playgroud)

有人可以建议一下,如何实现这一点吗?

提前致谢。

powershell amazon-ec2

1
推荐指数
1
解决办法
2888
查看次数

标签 统计

amazon-ec2 ×1

nginx ×1

php-7 ×1

php-7.1 ×1

powershell ×1