Using MAMP (on a Mac), with Yii installed in /Application/MAMP/htdocs I was able to create a web app by changing into /htdocs/framework and then running
php yiic webapp ../demo
This created a demo app in the htdocs folder.
Now I am trying to access the shell to do CRUD. I moved into /htdocs/demo
/Application/MAMP/htdocs/framework/yiic shell
but I got command not found.
I tried
./protected/yiic shell
and it printed out a long page with the title
<title>PHP Error</title>
Does anyone know how I can access the shell to do crud?
I know that I can use Gii to do CRUD, but i’m following a tutorial that does some other stuff with the shell so I need to learn how to use it.
got a similar case, but it is on a warning on using date() without setting up the timezone first.
Warning: date(): It is not safe to rely on the system’s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Los_Angeles’ for ‘PST/-8.0/no DST’ instead in /Applications/MAMP/htdocs/yii/framework/views/exception.php on line 217
similar to the call of date() at this line: /Applications/MAMP/htdocs/demo/protected/views/layouts/main.php(48)
the error is documented on the php.net manual section: function.date-default-timezone-set.php
so just add:
date_default_timezone_set(‘America/Los_Angeles’);
at those two lines mentioned above fixed the issue.