showdoc 是 PHP 開發的一款 api 文檔系統,因此所需環境和普通 PHP 項目一致
準備環境:
php
nginx
composer //注意更換國內鏡像,否則速度會很慢,甚至失敗
創建項目
composer create-project showdoc/showdoc
配置 showdoc 寫權限
chmod a+w showdoc/install
chmod a+w showdoc/Sqlite
chmod a+w showdoc/Sqlite/showdoc.db.php
chmod a+w showdoc/Public/Uploads/
chmod a+w showdoc/Application/Runtime
chmod a+w showdoc/server/Application/Runtime
chmod a+w showdoc/Application/Common/Conf/config.php
chmod 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.ini
extension=php_sqlite3.dll
extension=php_pdo_sqlite.dll
安裝
瀏覽器輸入: showdoc.leesin.me/install
選擇語言并確定,安裝完成點擊進入首頁
訪問使用
http://showdoc.leesin.me/web
即可使用
轉載于:https://blog.51cto.com/12750968/2109172