一款不错的PHP目录列表程序:h5ai安装教程

104次阅读
没有评论

共计 840 个字符,预计需要花费 3 分钟才能阅读完成。

简介

h5ai是一款功能强大的php文件目录列表程序,它提供多种文件目录列表呈现方式,支持Apache httpd, lighttpd, nginx等多种web服务器,支持多国语言(如英语,简体中文等),你可以在线预览txt,图片,音频,视频等文件格式。

h5ai官网:https://larsjung.de/h5ai/

截图

一款不错的PHP目录列表程序:h5ai安装教程

安装

要求:PHP 5.5+

1、搭建php网站环境
可使用军哥的lnmp、lamp一键包或者amh、vestacp、宝塔等面板程序搭建。

2、上传h5ai文件到网站根目录
h5ai本地下载地址:h5ai-0.29.0.zip,将文件解压后放在网站根目录。

3、修改配置文件
只需要在配置文件某个地方加上/_h5ai/public/index.php即可,比如:
Apache httpd 2.2 / 2.4:httpd.conf

DirectoryIndex  index.html  index.php  /_h5ai/public/index.php

lighttpd 1.4:lighttpd.conf

index-file.names += ("index.html", "index.php", "/_h5ai/public/index.php")

nginx 1.2:nginx.conf

index  index.html  index.php  /_h5ai/public/index.php;

最后重启服务器即可!并将要共享的文件均放到根目录(与_h5ai同一目录下)。

注意

如果存在文件,但读不出来,可能原因就是php已禁用scandir函数了,请修改php.ini解决。

disable_functions=passthru,exec,system,chroot,scandir,...

删掉scandir,字样,再重启php即可:/etc/init.d/php-fpm restart。

把h5ai程序_h5ai中private和public两个文件夹中的cache目录权限设置为777。

正文完
 
admin
版权声明:本站原创文章,由 admin 2019-09-18发表,共计840字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)
验证码