Before installing, make sure you have Composer installed on your system. If not, follow the steps below:
"; echo "**Make sure you have shell_exec() enabled in your php.ini
"; // Step1: Download Composer echo "Visit Composer Download Page to download and install Composer on your system or click the button below:
"; // Check if composer.phar is not present in the project root if (!file_exists('composer.phar')) { // Display the form to download and install Composer echo ''; } else { // Display a success message with a completed icon echo 'Once Composer is installed, run composer install in your terminal or click the button below:
"; // Output a professional-looking HTML button that triggers another shell command when clicked echo ''; // Output PHP version and server info echo "Server Information: " . $_SERVER['SERVER_SOFTWARE'] . "
"; // Check if the button is clicked if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['executeCommand'])) { // Replace 'your-other-shell-command' with the actual shell command you want to execute $otherShellCommand = 'php composer.phar install'; // Execute the other shell command $otherOutput = shell_exec($otherShellCommand); // Output the result of the other shell command echo "Application Successfully Installed! Redirecting in 5 Seconds
$otherOutput"; } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['composerCommand'])) { $command1 = "php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\""; $command2 = "php composer-setup.php"; $command3 = "php -r \"unlink('composer-setup.php');\""; // Execute the other shell command $otherOutput1 = shell_exec($command1); $otherOutput2 = shell_exec($command2); $otherOutput3 = shell_exec($command3); echo "
Installing...:
$otherOutput1
$otherOutput2
$otherOutput3"; header("Refresh:0"); } // You can choose to exit here or continue with the rest of your code echo '