半点优化网 http://www.bdxc.net/
当前位置首页 > 网站技术问题> 正文

如何解决php输入框显示源代码?

2022-06-02 06:54:44 暂无评论 80 网站技术问题 源代码   输入   解决

首先你要跑的是php脚本,php环境是必须的!

浏览器只能解析静态资源(js css html)

php文件要依.php结尾。请看下这个流程 ,了解web开发,b/s交互流程。了解各个组件的任务角色。

这种情况一般是服务器配置的问题,比如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;

}

--------河南新华

猜你喜欢