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.
Your code works for me, kindly check if
systemfunction is disabled for you. You can useini_get('disable_functions')to check if it is disabled.