{"id":9280,"date":"2026-06-02T03:14:51","date_gmt":"2026-06-02T01:14:51","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9280"},"modified":"2026-06-02T03:14:52","modified_gmt":"2026-06-02T01:14:52","slug":"impachetarea-si-despachetarea-fisierelor-pe-un-server-folosind-ssh-sau-un-script-php","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/","title":{"rendered":"Ambalarea \u0219i dezambalarea fi\u0219ierelor pe un server utiliz\u00e2nd SSH sau un script PHP"},"content":{"rendered":"<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">When managing a hosting account, you may need to quickly compress or extract files directly on the server. This can significantly speed up deployments and reduce the need for FTP transfers. Below are two common methods: using SSH or using a PHP script.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Method_1_%E2%80%93_Using_SSH\" >Method 1 \u2013 Using SSH<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Create_a_ZIP_archive\" >Create a ZIP archive<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Extract_a_ZIP_file_in_the_same_directory\" >Extract a ZIP file in the same directory<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Extract_a_ZIP_file_to_a_specific_folder\" >Extract a ZIP file to a specific folder<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Method_2_%E2%80%93_Using_a_PHP_Script\" >Method 2 \u2013 Using a PHP Script<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Extracting_ZIP_files\" >Extracting ZIP files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Creating_ZIP_archives\" >Creating ZIP archives<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Additional_Notes\" >Additional Notes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/mybox.com\/help\/ro\/knowledgebase\/packing-and-unpacking-files-on-a-server-using-ssh-or-a-php-script\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Method_1_%E2%80%93_Using_SSH\"><\/span>Method 1 \u2013 Using SSH<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After enabling SSH access and logging into your hosting account, you can manage archives directly from the command line.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_a_ZIP_archive\"><\/span>Create a ZIP archive<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<\/div>\n\n<div id=\"mybox-3526845097\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Acces timpuriu<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Mai ave\u021bi nevoie de ajutor?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contacta\u021bi echipa noastr\u0103 de servicii pentru clien\u021bi.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Trimite mesaj<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">To compress a folder into a ZIP file, use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>zip -r archive_name.zip folder_name\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will create a compressed archive containing all files and subfolders inside the specified directory.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Extract_a_ZIP_file_in_the_same_directory\"><\/span>Extract a ZIP file in the same directory<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To unpack an archive in its current location, use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>unzip archive_name.zip\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Extract_a_ZIP_file_to_a_specific_folder\"><\/span>Extract a ZIP file to a specific folder<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to extract files to a different directory, specify the destination path:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>unzip archive_name.zip -d destination_folder\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is useful when deploying applications or restoring backups into specific locations.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Method_2_%E2%80%93_Using_a_PHP_Script\"><\/span>Method 2 \u2013 Using a PHP Script<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If SSH access is not available, you can use a PHP-based solution to manage ZIP archives directly from your browser.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Extracting_ZIP_files\"><\/span>Extracting ZIP files<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For large archives containing hundreds or thousands of files, uploading them uncompressed via FTP can be inefficient. Instead, you can use a script such as <strong>Unzipper<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To use it:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Upload <code>unzipper.php<\/code> to your domain\u2019s root directory (for example, <code>public_html<\/code>)<\/li>\n\n\n\n<li>Upload the <code>.zip<\/code> archive you want to extract to the same directory<\/li>\n\n\n\n<li>Run the script via your browser<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The script will extract all files directly on the server, saving time and bandwidth.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Creating_ZIP_archives\"><\/span>Creating ZIP archives<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Some PHP tools also allow you to create ZIP archives directly on the server. This can be useful when backing up folders already stored on your hosting account.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Typically, you:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Select the folder you want to compress<\/li>\n\n\n\n<li>Execute the archive creation function<\/li>\n\n\n\n<li>Download or move the resulting <code>.zip<\/code> file as needed<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Additional_Notes\"><\/span>Additional Notes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you are working with FTP, you may also need a proper FTP client configuration to upload or download files efficiently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For reference, see your hosting provider\u2019s guide on connecting via FTP to manage files more easily.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Both SSH and PHP-based tools provide efficient ways to manage file archives on a server. SSH offers faster and more flexible control for advanced users, while PHP scripts are useful when SSH access is not available.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[39,54],"manual_kb_tag":[288,517,762,1326,1522,3619,5632,5633,5634,5635],"class_list":["post-9280","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-php-operations","manualknowledgebasecat-ssh","manual_kb_tag-web-hosting","manual_kb_tag-hosting-account","manual_kb_tag-file-compression","manual_kb_tag-command-line","manual_kb_tag-archive-extraction","manual_kb_tag-ssh-access","manual_kb_tag-server-management","manual_kb_tag-zip-archive","manual_kb_tag-unzip-files","manual_kb_tag-archive-creation"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9280\/revisions"}],"predecessor-version":[{"id":9286,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb\/9280\/revisions\/9286"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/media?parent=9280"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9280"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/ro\/wp-json\/wp\/v2\/manual_kb_tag?post=9280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}