ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
1. 去phpstudy官网下载最新的phpstudy。 下载请点击:[phpstudy官网](http://www.phpstudy.net/download.html) 注:可以下载自己需要的版本 2. 升级phpstudy里面的php版本。 到php官网下载和phpstudy对应的php版本。 下载请点击:[php下载](http://php.net/downloads.php) >[danger] 注: 下载的php文件要是zip格式的才可以 2.1 解压下载的php源码包(php-7.1.15-nts-Win32-VC14-x64.zip) 2.2 解压出来的目录重命名为(php-7.1.15-nts) 和 phpstudy的保持一致,放到phpstudy的php目录下面 2.3 完全退出phpstudy之后,重新启动,切换版本就能看到刚刚更新的。 3. 升级phpstudy的mysql版本 去mysql下载对应的mysql服务器包。 下载请点击:[mysql下载](https://dev.mysql.com/downloads/mysql/) >[danger] 注:一定要下载windows版本的mysql包 3.1 下载之后解压mysql包,检查解压出来的包的格式是否和phpstydy里面mysql目录内的文件,格式是不是一致的。 3.2 一致的话,直接重启phpstudy的服务。检查能不能启动成功,启动成功之后,用mysql可视化工具或者命令行工具连接一下mysql。检查是否能正常连接成功。 >[danger] 注:升级之后启动报错的话,参考下面的错误处理。 >[info] 升级mysql 启动报错。table performance_schema.session_variables doesnt exist >解决办法: 用命令 进入到mysql 的 bin 目录 执行升级命令 ~~~php mysql_upgrade -u root -p --force systemctl restart mysqld #这条命令可能会报错 ,报错请忽略 ~~~ 4. 安装php扩展 >[info] 由于是windows版本的,安装扩展需要下载后缀名为 .dll 的文件 下载请点击:[php扩展](https://windows.php.net/downloads/pecl/releases/) 4.1 下载好之后,把下载的文件复制到,php目录下的ext目录中 4.2 在对应的php文件当中,修改php.ini文件。配置并且开启下载的扩展。 4.3 保存并且重启服务,检查是否生效。 >[danger] 下载扩展文件的时候,一定要对应自己系统的才可以 5. 安装xdebug调试工具 在xdebug官网下载对应的 .dll 文件 下载请点击:[xdebug下载](https://xdebug.org/download.php) 不知道怎么下载请点击:[下载帮助](https://xdebug.org/wizard.php) 5.1 把下载的 .dll 文件放到 php目录下的ext目录中 5.2 在对应的php文件的,php.ini里面,打开xdebug文件 简单配置如下: ~~~php [XDebug] zend_extension = D:\phpStudy\PHPTutorial\php\php-7.1.13-nts\ext\php_xdebug-2.6.0-7.1-vc14-nts.dll xdebug.remote_enable =1//是否开启 xdebug.remote_host = "localhost"//调试地址 xdebug.remote_port = 9009//调试端口号码 xdebug.profiler_output_dir="D:\phpStudy\PHPTutorial\tmp\xdebug" xdebug.trace_output_dir="D:\phpStudy\PHPTutorial\tmp\xdebug" ~~~ 6. phpstudy 隐藏入口的 index.php 具体步骤参考:[tp5隐藏入口文件](https://www.kancloud.cn/manual/thinkphp5/177576) 7. phpstudy 配置多项目,在nginx服务器中 在nginx的配置如下: ~~~php server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; root "D:/phpStudy/PHPTutorial/WWW"; ##地址 location / { index index.html index.htm index.php l.php; autoindex off; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } #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; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # 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_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } ~~~ >[info] 配置多个项目,把上面的参数复制一份就行。 >更改端口号: listen >更改项目路径: root 格式一定是以 / 间隔的路径 >[danger] 注:若觉得容易复制出错的话,可以引入配置文件。 >把项目的文件单独一个文件保存。然后在 nginx.conf 中 include 文件名就行了。 文件名 以 .conf 结尾