统信UOS开发环境支持php

UOS对PHP开发环境提供了灵活的选择,在这里开发者可以轻松搭建开发环境,是开发者最理想的选择。

在这里插入图片描述
在这里插入图片描述


一、环境部署

php开发环境安装

php为服务器开发语言,因此除了需要安装php本身以外还需要服务器,php开发环境安装步骤如下:
1)安装php

sudo apt install php php-fpm

2)安装nginx

sudo apt install nginx

3)修改nginx配置文件/etc/nginx/sites-enabled/default,找到文件中以下内容并修改(注意使用root权限修改文件)

index index.html index.htm index.nginx-debian.html;
……
#location ~ \.php$ {
   
    
    
#       include snippets/fastcgi-php.conf;
#       # With php-fpm (or other unix sockets):
#       fastcgi_pass unix:/run/php/php7.3-fpm.sock;
#       # With php-cgi (or other tcp sockets):
#       fastcgi_pass 127.0.0.1:9000;
#}

4)修改为:

index index.php
……
location ~ \.php$ {
   
    
    
       include snippets/fastcgi-php.conf;
#     # With php-fpm (or other unix sockets):
       fastcgi_pass unix: