我正在尝试设置wordpress服务器,但是在此之前,我需要先使PHP工作。目前,我已经安装并配置了nginx和php 7.3,但是php并未呈现,它只是显示文本。主要问题:[root@a-knapsack-sav ~]# cat /usr/share/nginx/html/info.php<?phpphpinfo();?>[root@a-knapsack-sav ~]# curl http://localhost/info.php<?phpphpinfo();?>显然,我应该期望从上面看到一些内容,但是我没有。以下是我完成的所有设置。希望有人能看到这一点并指出我可能的遗漏。您正在使用什么操作系统?[root@a-knapsack-sav nginx]# rpm -q centos-releasecentos-release-7-6.1810.2.el7.centos.x86_64甚至安装了nginx吗?[root@a-knapsack-sav nginx]# nginx -vnginx version: nginx/1.15.12php甚至被安装了吗?[root@a-knapsack-sav nginx]# php -vPHP 7.3.5 (cli) (built: Apr 30 2019 08:37:17) ( NTS )Copyright (c) 1997-2018 The PHP GroupZend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.5, Copyright (c) 1999-2018, by Zend TechnologiesNginx安装在哪里?[root@a-knapsack-sav nginx]# pwd/etc/nginx[root@a-knapsack-sav nginx]# lsconf.d fastcgi_params koi-utf koi-win mime.types modules nginx.conf scgi_params sites-available sites-enabled uwsgi_params win-utfphp-fpm是否正在运行?[root@a-knapsack-sav nginx]# systemctl status php-fpm● php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; vendor preset: disabled) Active: active (running) since Fri 2019-05-03 10:42:25 CDT; 7h ago Main PID: 2772 (php-fpm) Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec" CGroup: /system.slice/php-fpm.service ├─2772 php-fpm: master process (/etc/php-fpm.conf) ├─2773 php-fpm: pool www ├─2774 php-fpm: pool www ├─2775 php-fpm: pool www ├─2776 php-fpm: pool www └─2777 php-fpm: pool wwwNginx还在运行吗?
1 回答
慕盖茨4494581
TA贡献1850条经验 获得超11个赞
在理查德·史密斯(Richard Smith)提出问题之后,nginx -T
发现我有另一个有效的conf正在干扰我的配置/etc/nginx/conf.d/default_original.conf
。所以我确实mv /etc/nginx/conf.d/default_original.conf /etc/nginx/conf.d/default.conf.original
使它不再加载,并将其更改include /etc/nginx/fastcgi_params;
为include fastcgi_params;
in /etc/nginx/sites-available/default.conf
。完成此操作后,我重新启动了nginx(systemctl restart nginx
),并curl http://localhost
返回了html表的预期输出。
- 1 回答
- 0 关注
- 279 浏览
添加回答
举报
0/150
提交
取消