Jump to content

Recommended Posts

In shell you can do wget and hence we can use system to execute it from linux.

 

Now curl offers similar functionality and from the looks of it, it has more options.

 

Which is better to use?

 

My only preference is that I do not want the php page calling those to wait for them to get the file. That is I would like them to run in the background.

 

Thanks

 

Its not really a case of which is better to use, it is a case of what do you want to do with each.

WGET is fine for grabbing webpages and storing as static files, even grabbing images but not so great if lets say you wanted to spider a website checking all the links work, etc.

Its not really a case of which is better to use, it is a case of what do you want to do with each.

WGET is fine for grabbing webpages and storing as static files, even grabbing images but not so great if lets say you wanted to spider a website checking all the links work, etc.

 

My task is simple just download a file and look like a regular pc is downloading it. So far curl has done well.

 

My only requirement is to have the php script run in the background versus requesting it and waiting for it to get the file as the file might be 100+MB.

 

 

Then it needs to be run as a shell script. You could setup a cron to run it.

 

Ok I am running it on curl now, so that cant be changed?

 

 

By shell script you mean write a shell script and call using system in php right?. and the shell script would look like wget ... & ?

Did you just try something like:

 

`wget -nd something.com > /dev/null`

 

Read this note on exec() from the PHP manual:

Note: If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.