Code này để thuận tiện hơn cho việc chmod nhiều file và folder.



• Để chmod 777 all file and folder: Tạo một file có tên chmod.php có nội dung Code:

<?php system('find . -type d -exec chmod 777 {} \; 2>&1'); system('find . -type f -exec chmod 777 {} \; 2>&1'); echo("\n\nComplete!"); ?>

- Up lên host rồi chạy link đến chmod.php .
Ví dụ http://yourdomain.com/forum/chmod.php
• Để chmod về mặc định với folder là 755 và file là 644 thì làm như trên nhưng với nội dung file chmod.php như sau:
Code:

<?php system('find . -type d -exec chmod 755 {} \; 2>&1'); system('find . -type f -exec chmod 644 {} \; 2>&1'); echo("\n\nComplete!"); ?>

Lưu ý: một số host sẽ cấm vì sử dụng hàm -exec

Chia Sẻ:
Magpress

MagPress

Vestibulum bibendum felis sit amet dolor auctor molestie. In dignissim eget nibh id dapibus. Fusce et suscipit orci. Aliquam sit amet urna lorem. Duis eu imperdiet nunc, non imperdiet libero.

0 comments so far,add yours

Cám ơn đã ghé thăm BlogCNTT!
- Mọi thắc mắc, gợi ý hoặc bình luận xin chia sẻ bên dưới hoặc Liên Hệ
- Hãy viết bằng tiếng Việt có dấu để mọi người dễ đọc hơn!
Thank You!