Yii framework and Xampp server for php

[color="#1C2837"][size="2"]

[color="#1C2837"][size="2"]Hi,[/size][/color][/size][/color]

[color="#1C2837"][size="2"] On MacOS , I was installed xampp server. After that installed Yii framework in htdocs of xampp . I was successfully running index.php also

home,login page. For gii (code generator) i made changes in web configure & it also work fine,now when i create controller ID of Controller

Generator it show. [color="#555555"][font="Arial, Helvetica, sans-serif"][color="#FFFFFF"]e[/color][/font][/color][/size][/color]

[color="#1C2837"][size="2"][color="#555555"][font="Arial, Helvetica, sans-serif"][color="#FFFFFF"]"n[/color][/font][/color][/size][/color]

[size="2"][font="Arial, Helvetica, sans-serif"][/font][/size][font="Arial, Helvetica, sans-serif"][size="2"] [color="#FF0000"] generating controllers/TestController.php[/color][/size][/font]

[size=“2”][font=“Arial, Helvetica, sans-serif”][font=“inherit”][size=“2”][color="#FF0000"] Unable to write the file ‘/Applications/XAMPP/xamppfiles/htdocs/webroot/testdrive/protected/controllers/TestController.php’.[/color][/size][/font][font=“inherit”][size=“2”][color="#FF0000"]generating views/test/index.php

Unable to create the directory '/Applications/XAMPP/xamppfiles/htdocs/webroot/testdrive/protected/views/test'.[/color][/size][/font][/font][/size]

[color="#1C2837"][size="2"][color="#555555"][font="Arial, Helvetica, sans-serif"] [color="#FF0000"]done! [/color] [/font][/color]

[/size][/color]

[color="#1C2837"][size="2"]How to write file on particular path?

Please see attachment of screen shot. [/size][/color]

[color="#1C2837"][size="2"][b]1512

Screen shot 2011-04-19 at 11.14.29 AM.png

first check your folders permissions if you can write with php files or you can even create directories, this is general answer to your question.

@vilas979 You’re going to need to modify the permissions on your project directory. Open Terminal and do the following:

  1. Navigate to your /htdocs folder:

cd /Applications/XAMPP/xamppfiles/htdocs

  1. Run the following command:

sudo chmod -R 777 [project folder]

  • replace [project folder] with the directory name for your webapp (e.g. sudo chmod -R 777 myapp)
  1. You’ll be prompted to enter your account password (because sudo was used to elevate your permissions); simply type it in and press Enter.

  2. Test Gii, it should work now.

Note: the above steps make your webapp markedly insecure, so you wouldn’t want to use this in a production environment.

Regards,

TTS

Rainleader LLC

That’s the solution.

You really don’t want to run Gii on a production server anyway… ;)