database migration on shared hosting without console

I can run database migration on local with command "yiic migrate"

Can I run database migration on shared hosting if I only access to FTP but no console ?

Thank you.

Think about it…

can you run any command when you connect with FTP (other than FTP commands ofcourse)?

I dont think so

so I cannot use yii on this kind of hosting ?


Of course you can: just run a php script - I am using Yii on a shared host with no shell.

May I ask how to write the migrate php script ?


Also you can try using my webshell extension:

Got it. It works.

Thanks you all!

This works too:


$cmd = "./protected/yiic migrate --interactive=0";

$output = stream_get_contents(popen($cmd, 'r'));

echo $output;

I just tested it - I need to run this from an installer I’m coding.

Just wanted to say thanks for this thread, just saved me a ton of hassle. :)