技術誌記錄學習或專案執行當下遇到的問題及解決方案,方便日後翻查,益人益己!
今天在執行 composer require 套件安裝時出現 PHP Fatal error: Allowed memory size of xxx bytes exhausted 的錯誤訊息
php.ini
memory_limit
memory_limit = -1
php -d memory_limit=-1 composer.phar
在 Laravel 使用 Sqlite 為資料庫使用, 執行 migration rollback 的時候發生下列錯誤訊息:
SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification.
在 migration 的 down() 方法裡使用多個 dropColumn 但 Sqlite 不支援
$table->dropColumn('field1'); $table->dropColumn('field2');
用 array() 方式來改寫 dropColumn 即可
$table->dropColumn([ 'field1', 'field2', ]);