My Composer is not Working anymore because I reinstalled PHP.
How to resolve Composer dependency issues after reinstalling PHP on my Laravel project.
Cannot run program "/opt/homebrew/Cellar/php/8.4.5_1/bin/php" No such file or directory
This is the new Path: /opt/homebrew/bin/php
I want to Reload the Composer because I think it's messing up dependencies
Is there a way to Change the Path what I found so far didn't Work, or can I just delete the Composer and install a new one, or would that destroy my Project again?
I tried this inferred php script:
<?php
// Den aktuellen PHP-Pfad herausfinden
$currentPhpPath = exec('which php');
// Den neuen PHP-Pfad festlegen
$newPhpPath = '/usr/local/php/bin/php'; // Ändere diesen Pfad zu deinem gewünschten PHP-Pfad
// Überprüfen, ob der neue PHP-Pfad existiert
if (file_exists($newPhpPath)) {
// Den aktuellen Pfad setzen
putenv("PATH=$newPhpPath:" . getenv("PATH"));
echo "PHP-Pfad erfolgreich geändert zu: " . $newPhpPath;
} else {
echo "Fehler: Der angegebene PHP-Pfad existiert nicht.";
}
?>
$newPhpPath = '/opt/homebrew/bin';