8/29/2020

VS Code Autocomplete for Unity not working on Ubuntu 20.04

Visual Source Code 在開 Unity 專案時, 出現了類似的訊息

OmniSharp...
... Target Framework 4.7.1 not found ....

然後專案無法 Load 進來

原因是因為電腦中 Mono 的版本還不夠高, 沒支援到 .Net Framework 4.7.1

請參考這篇解決


解決步驟如下

1. 先到 https://www.mono-project.com/download/stable/ 安裝最新版的 Mono

2. 在自己的 Home 底下, 找到 .bashrc, 加入下面這列

    export FrameworkPathOverride=/lib/mono/4.5

3. Logout 再 Login


7/24/2020

PHP on Visual Studio Code

Ubuntu 20.04

Install XDebug
https://xdebug.org/docs/install

PHP Debug Adapter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug

$ cd /etc/php/7.4/mods-available

$ gedit xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1

$ phpenmod xdebug

$ sudo service apache2 start

In Visual Studio Code, launch.json

{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000,
"runtimeExecutable": "/usr/bin/php"
}
]
}

4/10/2020

Migrate PrestaShop 1.7.x to another hosting with different domain

最近一個 Project 是用 PrestaShop + Template 做的,但是發現 PrestaShop 沒有像 Wordpress 有很多 Free 的 Addon 可以用, 也沒找到免費的 Migrate Tool, 所以就是手動搬了.

Step 如下

  1. Backup 整個 PrestaShop 的 Folder
  2. 用 phpAdmin 把整個 DB Export 出來
  3. 到新的 Hosting 上先安裝一份 PrestaShop, 確定可以 work, 然後把 Files copy 到另一個 Directory 將來可以參考
  4. 把 Backup 起來的 Files upload 並且 overwrite 整個 folder
  5. Create DB, 把資料 Import 進來
  6. 如果有必要, 修改一下 DB Connection 的部份, 在 [webroot]/app/config/parameters.php
  7. 用 phpAmdin, 找到 [pfx]_shop_url, 修改裡面相對應的資料
  8. 把 [webroot]/var/cache/prod 刪掉