2021年11月14日 星期日

*網頁人生* linux ubuntu php8 降版至 php 7.4

剛剛因為環境需要新版的php

直接apt-get update的方式就直接更新成php8 最新版

不過自己使用的drupal 的需求是要php3以上就好

只好來降版本了

還好網路上有參考資料 直接照做就完成降版了👍👍

下面記錄一下 以後應該還是會有機會手滑更新到

最後只要php -v檢查有沒有成功就OK了


sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
 
sudo apt-get install php7.4
(因為排版需求這邊有斷行 實際複製要取消斷行喔)
sudo apt-get install php7.4-cli php7.4-common php7.4-json
php7.4-opcache php7.4-mysql php7.4-mbstring  php7.4-zip
php7.4-fpm php7.4-intl
php7.4-simplexml

// a2dismod disables the php8.0 module by removing those symlinks.
sudo a2dismod php8.0
 
// a2enmod enables php7.4 module within the apache2 configuration.
sudo a2enmod php7.4
 
// Restart apache2 service.
sudo service apache2 restart  
 
// Set alternative name path.
sudo update-alternatives --set php /usr/bin/php7.4
sudo update-alternatives --set phar /usr/bin/phar7.4
sudo update-alternatives --set phar.phar /usr/bin/phar.phar7.4
sudo update-alternatives --set phpize /usr/bin/phpize7.4
sudo update-alternatives --set php-config /usr/bin/php-config7.4

2021年1月14日 星期四

*網頁人生* LINE及FB分享網址 免用SDK

 

JS範例

window.open("https://lineit.line.me/share/ui?url=" + location.href);

window.open("https://www.facebook.com/sharer/sharer.php?u=" + location.href);

可依照需求放在事件中