千家信息网

Showdoc 搭建项目 API 文档系统

发表于:2024-09-30 作者:千家信息网编辑
千家信息网最后更新 2024年09月30日,showdoc 是 PHP 开发的一款 api 文档系统,因此所需环境和普通 PHP 项目一致准备环境:phpnginxcomposer //注意更换国内镜像,否则速度会很慢,甚至失败创建项目comp
千家信息网最后更新 2024年09月30日Showdoc 搭建项目 API 文档系统

showdoc 是 PHP 开发的一款 api 文档系统,因此所需环境和普通 PHP 项目一致

准备环境:
php
nginx
composer //注意更换国内镜像,否则速度会很慢,甚至失败

创建项目

composer create-project showdoc/showdoc

配置 showdoc 写权限

chmod a+w showdoc/installchmod a+w showdoc/Sqlitechmod a+w showdoc/Sqlite/showdoc.db.phpchmod a+w showdoc/Public/Uploads/chmod a+w showdoc/Application/Runtimechmod a+w showdoc/server/Application/Runtimechmod a+w showdoc/Application/Common/Conf/config.phpchmod a+w showdoc/Application/Home/Conf/config.php

配置服务器

下面的配置时windows环境,如果要使用linux ,注意可能需要修改一些配置项#=== showdoc ==  server {         listen       80;         server_name   showdoc.leesin.me;         charset utf-8;         #access_log  logs/host.access.log  main;         root  E:\showdoc;         index index.php index.html;         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;         }         location ~ \.php$ {             fastcgi_pass   fastcgi_backend;  # linux无法使用这种方式,而是 127.0.0.1:9000方式             fastcgi_index  index.php;             include        fastcgi_params;             fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;             fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;         } } 配置 hosts     127.0.0.1   showdoc.leesin.me 重启 nginx 服务

开启sqlite 相关扩展

php.iniextension=php_sqlite3.dllextension=php_pdo_sqlite.dll

安装

浏览器输入: showdoc.leesin.me/install 选择语言并确定,安装完成点击进入首页

访问使用

http://showdoc.leesin.me/web即可使用
0