【開発】Windowsのローカル環境で動いていたCodeIgniterのコードがMacで動かなかった

原因1

mysqlのソケットが正しくなかった。
ので、macphp.iniに追加した。
cp /etc/php.ini.default /etc/php.ini
vim /etc/php.ini
追加:
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock
【参考: http://www.hi-ho.ne.jp/tsumiki/book_sup2.html


原因2

セッションファイルの書き込みに失敗していた
https://teratail.com/questions/12993
mkdir /Users/shima/Documents/tmp
chmod 777 /Users/shima/Documents/tmp
CodeIgniterのconfig.php
追加:
$config['sess_save_path'] = '/Users/shima/Documents/tmp';
【参考: https://teratail.com/questions/12993