Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8932575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:20:41+00:00 2026-06-15T09:20:41+00:00

I need to perform some tar gzip operation inside a php script running on

  • 0

I need to perform some tar gzip operation inside a php script running on Apache (php5.3).

In the past, I’ve used:

new PharData($archivePath . '.tar');
$p = $p->convertToExecutable(Phar::TAR, Phar::GZ);
$p->startBuffering();

However in this case it could have to handle 1GB+ files. So I’m worried about overloading php/apache.

In that case, is it best to rely on shell_exec & let the os take the load?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:20:42+00:00Added an answer on June 15, 2026 at 9:20 am

    I agree with Marc B, the major considerations I would think of are:

    Deployment Environment… Using Shell ties you to an environment where shell commands can run, and tar is accessible. Using Phar is nice because if the extension is installed, you should be good to go. With shell you’re now tied to linux as well, unless you put the logic in to work in windows as well.

    Also, security issues… While it is definitely possible to run shell commands from php without introducing vulnerabilities, it does provide a way now for malicious people to run a command if you accidently don’t scrub the data good enough. Also, tar will die if you run out of space with who knows what, whereas if you use Phar, you should get a reasonable error message from php indicating the problem, instead of just a bad return code.

    One advantage of shell, is that if you run the command asynchronously and get a stream from stdout you can monitor progress, sort of.

    Either way, half a dozen of one, 6 of the other…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently developing a module for Apache 2/2.2 and need to perform some
I have a list of EmpIds. I need to perform some operation for each
In a custom View, I need to perform some additional work inside onDraw() if
I need to perform some modifications to PHP files (PHTML files to be exact,
I need to perform some initialization when new instances of my domain class are
I need to perform some operations on all folders within a file share which
I have a class that I need to perform some actions on but I
I am developing a Firefox extension and I need to perform some high-speed calculations
I'm developing an application through Core Data and I need to perform some calculation
I have a lotus view that stores a number. I need to perform some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.