Skip to content

Instantly share code, notes, and snippets.

@unique1984
Last active May 26, 2021 11:16
Show Gist options
  • Select an option

  • Save unique1984/b2aa9cb8e00e615c7a2d773aeb638570 to your computer and use it in GitHub Desktop.

Select an option

Save unique1984/b2aa9cb8e00e615c7a2d773aeb638570 to your computer and use it in GitHub Desktop.
PHP için sistem geneli versiyon değiştirme scripti
#!/usr/bin/env bash
function getPhpVersion {
PHPVERSION=$(php -r 'echo substr(phpversion(),0,3);')
}
getPhpVersion
#~ echo $PHPVERSION
#~ exit
if [ -z $1 ]; then
echo -e "PHP Versiyonunu girmediniz! <phpVersionChange.sh [5.6 | 7.0 | 7.1 | 7.2 | 7.3 | 7.4 | 8.0]>"
echo -e "Güncel versiyon -> $PHPVERSION"
exit
fi
#sudo a2dismod php$PHPVERSION
#sudo systemctl stop php$PHPVERSION-fpm
#sudo systemctl disable php$PHPVERSION-fpm
#sudo systemctl stop apache2
sudo update-alternatives --set php /usr/bin/php$1
sudo update-alternatives --set phar /usr/bin/phar$1
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$1
sudo update-alternatives --set phpize /usr/bin/phpize$1
sudo update-alternatives --set php-config /usr/bin/php-config$1
sudo update-alternatives --set php-cgi /usr/bin/php-cgi$1
sudo update-alternatives --set php-cgi-bin /usr/lib/cgi-bin/php$1
sudo update-alternatives --set phpdbg /usr/bin/phpdbg$1
#~ sudo update-alternatives --set php-fpm.sock /run/php/php$1-fpm.sock
# sudo update-alternatives --config php
getPhpVersion
#~ echo -e $1
#~ echo -e $PHPVERSION
#~ if [ $1 = $PHPVERSION ]; then
#~ fi
#sudo systemctl enable php$PHPVERSION-fpm
#sudo systemctl start php$PHPVERSION-fpm
#sudo a2enmod php$PHPVERSION
#sudo systemctl start apache2
@unique1984
Copy link
Copy Markdown
Author

unique1984 commented Feb 27, 2019

Scriptin kullanımı ekran görüntüsündeki gibidir.

phpversionchange

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment