如何解決php輸入框顯示原始碼?Xian392020-04-01 22:08:15

這種情況一般是伺服器配置的問題,比如nginx沒有開啟php的模組,或者沒有安裝php

一般找到nginx。conf把php那塊前面的註釋去掉,重啟就行

location / {

index index。php index。html index。htm;

try_files $uri $uri/ /index。php?$args;

}

location ~ \。php$ {

#fastcgi_pass 127。0。0。1:9000;

fastcgi_pass unix:/home/php7/var/run/php-fpm。sock;

fastcgi_index index。php;

include fastcgi_params;

}

如何解決php輸入框顯示原始碼?嚮往慢生活VLOG2020-04-01 20:45:22

首先你要跑的是php指令碼,php環境是必須的!

瀏覽器只能解析靜態資源(js css html)

php檔案要依“。php”結尾。請看下這個流程 ,瞭解web開發,b/s互動流程。瞭解各個元件的任務角色。

如何解決php輸入框顯示原始碼?慎談奧秘2020-04-06 17:12:03

這種情況一般是伺服器配置的問題,比如nginx沒有開啟php的模組,或者沒有安裝php

一般找到nginx。conf把php那塊前面的註釋去掉,重啟就行

location / {

index index。php index。html index。htm;

try_files $uri $uri/ /index。php?$args;

}

location ~ \。php$ {

#fastcgi_pass 127。0。0。1:9000;

fastcgi_pass unix:/home/php7/var/run/php-fpm。sock;

fastcgi_index index。php;

include fastcgi_params;

}

————河南新華