Failed To Create Module In Yii

I am getting this error, while i was trying to create a module with gii.

please see the snapshot i attached.

There was some error when generating the code. Please check the following messages.

Generating code using template "/var/www/yii/framework/gii/generators/module/templates/default"…

generating modules/invmgmt/InvmgmtModule.php

       Unable to create the directory '/var/www/amantran/protected/modules/invmgmt'.

generating modules/invmgmt/controllers/DefaultController.php

       Unable to create the directory '/var/www/amantran/protected/modules/invmgmt/controllers'.

generating modules/invmgmt/views/default/index.php

       Unable to create the directory '/var/www/amantran/protected/modules/invmgmt/views/default'.


Check the directory permissions of the filesystem.

The webserver (www-data?) must be able to create the directories.

Please try to run the following commands in terminal before creating the module:

mkdir /var/www/amantran/protected/modules

chmod 777 /var/www/amantran/protected/modules

thanks…Emile Bons

it’s permission problem as you said. after i altered permissions it’s working fine.