我正在尝试设置wordpress服务器,但是在此之前,我需要先使PHP工作。目前,我已经安装并配置了nginx和php 7.3,但是php并未呈现,它只是显示文本。
主要问题:
[root@a-knapsack-sav ~]# cat /usr/share/nginx/html/info.php
<?php
phpinfo();
?>
[root@a-knapsack-sav ~]# curl http://localhost/info.php
<?php
phpinfo();
?>
显然,我应该期望从上面看到一些内容,但是我没有。以下是我完成的所有设置。希望有人能看到这一点并指出我可能的遗漏。
您正在使用什么操作系统?
[root@a-knapsack-sav nginx]# rpm -q centos-release
centos-release-7-6.1810.2.el7.centos.x86_64
甚至安装了nginx吗?
[root@a-knapsack-sav nginx]# nginx -v
nginx version: nginx/1.15.12
php甚至被安装了吗?
[root@a-knapsack-sav nginx]# php -v
PHP 7.3.5 (cli) (built: Apr 30 2019 08:37:17) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.5, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.5, Copyright (c) 1999-2018, by Zend Technologies
Nginx安装在哪里?
[root@a-knapsack-sav nginx]# pwd
/etc/nginx
[root@a-knapsack-sav nginx]# ls
conf.d fastcgi_params koi-utf koi-win mime.types modules nginx.conf scgi_params sites-available sites-enabled uwsgi_params win-utf
php-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 www
Nginx还在运行吗?
慕盖茨4494581