Question: A fairly simple problem, I think. Here's my testing code (obviously I'll add security precautions when I'm writing this for real) -

```
<?php
    if (isset($_POST['url']) && !empty($_POST['url'])) {
        system('wget --no-parent --timestamping --convert-links --page-requisites --no-directories --no-host-directories -erobots=off '.$_POST['url']);
} else {
    echo '<form method="post"><input type="url" name="url"><input type="submit"></form>';
}

?>

```

Is there some module in PHP or Apache2 that I need to enable/install for this to work? I'm visiting this page through the browser, if that helps. This happens even when the command has not been called yet (that part of the `if` statement is not run), and the 500 Error goes away if I comment out the system() or exec() line.

Answer: 
```
class YourClass extends AsyncTask<...>
{
    ProgressDialog dialog;
    Protected void onPreExecute(){
        // create dialog here
       dialog= new ProgressDialog (...);
    }
    protected void onPostExecute(Bitmap image){
        //
        dialog.dismiss();
    }
}

```
You need to declare the `ProgressDialog dialog` outside the `onPreExecute()`
Declare the dialog in the activity and then use in the preExecute() and postExecute() methods.  

Declare like this in teh activity or inside the async task 

```
ProgressDialog dialog=new Progress Dialog(YourActivity.this);

```

Then use the dialog in onPreExecute() as

```
 dialog.setMessage("Your Messgae");
 dialog.show();

```

and in onPostExecute() as 

```
dialog.dismiss();

```