Search code examples
phpyiixampphtdocs

yii framework not working in mac


When creating a project in applications/xampp/htdocs using the yii framework in terminal, it's showing an error as permission denied. I can create projects in all other folders.

Here is the terminal command I've written:

% php yii/framework/yiic.php webapp /Applications/XAMPP/htdocs/pjt_1

The error shown was

PHP Error[2]: mkdir(): Permission denied
    in file /Applications/yii/framework/console/CConsoleCommand.php at line 457
#0 /Applications/yii/framework/console/CConsoleCommand.php(457): mkdir()
#1 /Applications/yii/framework/console/CConsoleCommand.php(455): WebAppCommand->ensureDirectory()
#2 /Applications/yii/framework/console/CConsoleCommand.php(366): WebAppCommand->ensureDirectory()
#3 /Applications/yii/framework/cli/commands/WebAppCommand.php(96): WebAppCommand->copyFiles()
#4 /Applications/yii/framework/console/CConsoleCommandRunner.php(68): WebAppCommand->run()
#5 /Applications/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
#6 /Applications/yii/framework/base/CApplication.php(162): CConsoleApplication->processRequest()
#7 /Applications/yii/framework/yiic.php(34): CConsoleApplication->run()

What should I do to allow access to xampp folder?


Solution

  • Right click on the pjt_1 folder and select "Get Info".

    In the popup window select the "Sharing and Permissions" tab.

    If it doesn't say this already, as an experiment, change the privilege next to "everyone" to "Read & Write". Then try creating your Yii application from the terminal again.