网站首页 > 技术教程 正文
PHP环境开启:
1.下载windows版本php程序,下载链接如下:
https://windows.php.net/downloads/releases/archives/
在选择合适的版本下载后,我这里 选择 php-8.3.4-Win32-vs16-x64.zip
我这里的存放路径为:
E:\Program Files\php-8.3.4-Win32-vs16-x64
可以将路径添加环境变量:
2.配置PHP配置文件php.ini
C:\Users\fengt>cd /d E:\Program Files\php-8.3.4-Win32-vs16-x64
E:\Program Files\php-8.3.4-Win32-vs16-x64>copy php.ini-development php.ini
已复制 1 个文件。
3.启动php-cgi守护进程,如下图
nginx环境配置:
下载windows nginx环境,我这里是 nginx-1.24.0
编辑配置文件,新增如下server
server {
listen 80;
server_name localhost;
#charset koi8-r;
access_log logs/local.access.log main;
error_log logs/local.error.log;
root E:/php_dev;
index index.php index.html index.htm;
location / {
# 尝试直接访问文件,如果不存在则尝试目录
try_files $uri $uri/ /index.php?$args;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
启动nginx
E:\Program Files\nginx-1.24.0> .\nginx.exe
编写php代码:
在 E:\php_dev\index.php 编写如下代码
<?php
echo phpinfo();
浏览器访问地址,查看PHP信息:
猜你喜欢
- 2024-10-17 服务器安装PHP网站的运行环境(服务器部署php项目)
- 2024-10-17 Laravel 部署发布:将您的应用程序部署到生产环境
- 2024-10-17 你没有看错:使用Android也可以搭建一个PHP WEB环境了
- 2024-10-17 图文教程:三分钟搞定Linux服务器建站环境
- 2024-10-17 本地集成环境PHPWAMP_IN3——墨涩网
- 2024-10-17 说说MAC搭建PHP环境遇到的问题(mac开发php用什么软件)
- 2024-10-17 PHP8知识详解:搭建PHP8集成环境(php 集成环境)
- 2024-10-17 零基础建站如何配置PHP运行环境 几种服务器环境配置的选择和方法
- 2024-10-17 你会用 Docker 搭建 PHP 开发环境吗?
- 2024-10-17 phpStudy nginx环境添加ssl证书(nginx 安装ssl)
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)