Current location: home page > Share findings > PHP directory listing program Zdir updated to v1.50

PHP directory listing program Zdir updated to v1.50

Published on: May 31, 2020 Share findings 38 comments 39,792 views
This website provides Linux server operation and maintenance, automated script writing and other services. If you need, please contact the blogger on WeChat: xiaozme

Zdir is a directory listing program developed using PHP. It does not need a database, and is easy to install and use. This v1.50 update is as follows.

Video Introduction

Zdir function

  • directory browse
  • MarkDown File Preview
  • CSS/JavaScript one click copy
  • File hash
  • Picture Preview
  • Video playback (partial formats such as. mp4. ts. m3u8 are supported)
  • Audio playback (supported .mp3 .wav .flac .ape
  • Text viewer (the supported formats are. txt. sh. py. go. c. cpp)
  • Office online preview (. doc. docx. xls. xlsx. ppt. pptx is supported), Note: Preview is not supported for intranet or IP access mode
  • File Index
  • QR code generation
  • File management (upload/delete/edit, etc.)
  • File Search
  • Password verification
  • Support Chinese display

V1.50 update instructions

  • This version can place Zdir in a subdirectory
  • Optimize CSS
  • Fix some bugs
  • New can be created static/tongji.js And add website statistics code, Zdir will automatically load
  • The user name and password of the file manager can be set at config.php
  • config.json Can support advertising settings

This version can put Zdir in the word directory

since v1.50 Zdir supports running in a subdirectory when the version starts. For example, your site directory is /data/wwwroot/default , you can place the Zdir source code in the /data/wwwroot/default/zdir Installing in a subdirectory requires pseudo static settings to work properly. Please refer to the help document for specific methods: https://www.yuque.com/helloz/zdir/install

Support adding statistics code

This version can create a new one in the Zdir directory tongji.js File, in which website statistics code is put, Zdir will load automatically. Note that statistics code is not required script Label, Baidu statistical code passed the test, and other statistical codes were not tested.

Setting of left and right suspended advertisements

This version supports the setting of suspended advertisements on the left and right sides of the website. You need to create a new file named config.json , content reference:

 { "gg":{ "gg_left":"<a href=' https://dwz.ovh/d ' target='_blank' rel="noopener noreferrer"><img src=' https://dwz.ovh/c '></a>", "gg_right":"<a href=' https://blog.xiaoz.org/archives/11183 ' target='_blank' rel="noopener noreferrer"><img src=' https://i.bmp.ovh/imgs/2019/11/39adab31131a53a8.png '></a>" } }

The display effect is as follows:

Upgrade method

Since the directory structure has changed this time, it is recommended to reinstall Zdir after backing up the data

Get Donated

Scan the QR code below, donation is greater than 30 yuan The above can be obtained as a donation version. The donation version can enjoy the first technical support and remove advertising. After donation, please contact my QQ: 337003006 to get it.

other


Post reply

Your email address will not be disclosed. Required items have been used * tagging


38 comments


  1. What's the difference between this and the default index of ngnix? It's better to use ztree with a clearer hierarchy

    1. The default index of nginx is simple to use, but its functions are very simple. For example, there is no search function, and it does not support file preview. The interface is also simple, and the mobile terminal is not adapted.

      I don't think you have used Zdir?

  2. Boss, I uploaded a ZIP file of about 25G, which can be displayed on the page (but displayed as a folder). Click the download prompt directory does not exist, and return to the home page after 3s! Thank you

  3. Boss, everything is normal. If you find a problem, please help solve it. The uploaded file in the login file management is less than 10m.

    1. Xiaobai only knows that he wants to create a new php.ini, but he can't do it. Please help me, thanks in advance!

  4. Hello, there is an error in the "Instruction for Use" column, which shows {"code": 0, "msg": " u6587 u4ef6 u4e0d_5b58 u5728 uff01"}
    However, it is normal as shown in the preview below. I have just installed nothing, as shown in the following figure: https://pic5.58cdn.com.cn/nowater/webim/big/n_v2753f4a4984ef4428b52014af473317e5.png

    1. 1. Strictly follow this help document: https://doc.xiaoz.me/books/zdir Install?
      2. In addition, the file is strictly case sensitive and correctly named README.md

  5. After the home page password is opened, you cannot log in and cannot verify it. You have to log in all the time. http://nas.paoti.com:5000/test/
    The user name and password I set are paoti

  6. The first time I contacted zdir, I found that the Chinese file names in the background had become garbled after I set up the local environment.

  7. The subdirectory is used for installation, and the calculation of md5 prompts that the directory is incorrect!

    Other functions are normal. The pagoda nginx environment is still set according to the tutorial

  8. Boss, it used to be normal, but now the file index suddenly has problems,
    use https://www.zjzj.xyz/down/index.php?c=cache&del=cache Rebuild cache prompt Unable to open file!
    When you access the file index, you will be prompted that the data will be cached at 09:20:24 on September 3, 2020
    Make sure that the cache folder directory and its internal file permissions are 755 and the ownership is www data
    It seems that this problem has not been encountered in versions before 1.5. It is not ruled out that it is caused by the upgrade of the ubuntu system
    The other two questions are to ask Big Brother Z:
    1. Website visited https://www.zjzj.xyz/down/?dir=/02%E5%B7%A5%E4%BD%9C%E8%BD%AF%E4%BB%B6
    Can you handle it? Dir=remove
    2. Because I don't use the secondary domain name, the access path is https://www.zjzj.xyz/down , click the, Will jump back https://www.zjzj.xyz ; The level is limited, and thedir and htacess have also been set; Please ask how to correctly return the secondary directory in this case

  9. Hello, landlord:
    I used the unread nas. I installed nginx with the docker, unzipped zdir, and used port mapping to access the Internet. However, only files of less than 2m can be uploaded on the Internet. Previously, it was said that the file size could be adjusted by modifying the php.ini file, but this file was not found
    // Maximum file upload size
    // Increase the following values in php.ini to work properly
    // memory_limit, upload_max_filesize, post_max_size
    define(‘MAX_UPLOAD_SIZE’, ‘22222’); Modification doesn't work. Please help me confirm. How can I modify it to upload normally?

      1. A php.ini file has been created in the directory, and the 100M file upload limit has been configured. The configuration in nginx.conf has also been changed to 100m. After restarting, a 7m file can be uploaded after multiple tests. It is strange that files over 8m can not be uploaded.

      2. The self built php.ini file is limited to 100m. You can upload about 8m files after restarting. I don't know why

    1. Recently, I tried to install zdir in Qunhui with web to enable pseudo static. I tried to install zidr and zdir in subdirectories, but it was very difficult,
      I referred to https://www.jietn.com/blog/45.html and https://www.mvgao.com/archives/16.html , they didn't get it done.
      Finally, reference https://post.smzdm.com/p/a997kdr7/ Build the pagoda panel, install centos, and then install the zidr directory list.

      Finally, because it is a private disk, I used Beauty Directory, which has a responsive UI, and it is particularly comfortable to watch on my mobile phone.
      For your reference https://soft.ulmt.com

  10. Try to install in Qunhui with web, and select the environment of PHP 7.2+APACHE2.4. Set the document root directory to 'web/zdir'. Place all files in the 'web/zdir' folder. Enter the domain name+port, the home page can be logged in successfully, and the index page displays' Unable to open file! ', The file management page goes directly to 404. The URL turns into domain name+port number/zdir/functions/admin. I manually remove/zdir and successfully log into the management page. Is there something wrong?

    1. Version 1.52-2020601. After a comprehensive check and reference to the previous version, I found that there was a problem with the string code in index.php.
      "`//If the current directory exists
      if( file_exists(‘./functions/admin.php’) ) {header(“Location: ./zdir/functions/admin.php”);
      exit;
      }
      else{header(“Location: ./functions/admin.php”);
      exit;
      }“`
      The above one is in the source code 1.52-2020601. The following is the latest 1.52-2020601 I downloaded from previous versions
      //If the current directory exists
      if( file_exists(‘./functions/admin.php’) ) {
      header(“Location: ./functions/admin.php”);
      exit;
      }
      else{
      header(“Location: ./zdir/functions/admin.php”);
      exit;
      }
      。。。。。。。。 So what is the situation. Do you have to add one· number

      1. 1. This problem has actually been fixed in v1.53, but I did not tag it. Just replace index.php with the master branch: https://github.com/helloxz/zdir/archive/master.zip
        2. I'll test the index again

        1. I also installed one in the NAS. The directory browsing is normal, but when I click the file, it will be 404. When I click the video player, it will show that "the video file does not exist".

          1. The default Apache and ngnix on most NAS disks do not support pseudo static settings,
            For a simple installation method, you only need to put the files in Zidr and the files displayed on the home page in zdir.

            I refer to this https://soft.ulmt.com/BeautyDir/README.html , successfully installed the website on Qunhui Nas disk.

  11. Very good program
    The program you developed and the image uploading program are very good
    Does the free version of the image upload community and this free version support virtual host installation
    No server
    In addition, does this program support static file html demonstration
    For example, it can run after uploading html

    1. 1. ImgURL Community Edition and Professional Edition both support virtual host installation, as long as the environment supports it
      2. The. html content does not need to be rendered, and the browser supports it by default, so you can upload the. html file as long as you can access it