Running A First Web App With Yii

Good day

I have been trying to create my first web app for yii, but I am struggling to get the correct results.

I have altered my .htacces file from having code already but I keep getting the permission denied error my system.

I was wondering whether there might be a file that needs to be amended as well.

Your response will be highly appreciated.

Plz show your htaccess.

before that check that index.php is located somewhere inside webroot and you’re requesting correct path

By any chance are you using WAMP? If so you should use this:

<ifModule mod_rewrite.c>

Turn on the engine:

RewriteEngine on

Don’t perform redirects for files and directories that exist:

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

For everything else, redirect to index.php:

RewriteRule ^(.*)$ index.php?/$1 [L,QSA]


Hi guys

Thanks for replying I have already set my path as see attachment and it didn’t work

I already tried running this script as well, see attachment in cmd and I got the access is denied error with this as well

here is my .htaccess file, but for some reason I cannot find the index.php file and I haven’t altered the yii folder since downloading it, would you paste me the contents of it here in this discussion.

RewriteEngine on

prevent httpd from serving dotfiles (.htaccess, .svn, .git, etc.)

RedirectMatch 403 /\…*$

if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

otherwise forward it to index.php

RewriteRule . index.php

Your help highly appreciated.

index.php should be right inside docroot folder (web? www? htdocs?) and it looks like this

// change the following paths if necessary

$yii = dirname(__FILE__) . '/../framework/yii.php';

$config = dirname(__FILE__) . '/protected/config/main.php';

// remove the following lines when in production mode

defined('YII_DEBUG') or define('YII_DEBUG', true);

// specify how many levels of call stack should be shown in each log message

defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);



Notice that this file is shipped with Yii, you don’t need to create one (of course, if you haven’t deleted it by chance)

Hi ORey

I cpouldn’t locate the file I’ll just add it automatically then.

Thanks alot I’ll let you know once I am successful.


there must be something I am missing within the framework that needs to be amended I am even running cmd as an administrator but I still get the same error any ideas guys.

Your help will be highly appreciated.

What is the error?

Hi Orey

It says xampp is not recognised as an internal or external command,

operable program or batch file.

I simply can’t do anything to remove it.

Thanks for the reply Orey.

By the way the index.php that you referred to is created with every web application that is created I realized this when examining the demo files that come with the yii framework.

yes, read the post above

Yes I am emphasisng that the index.php file that you have shown above is automatically created with each web application that is created and it can’t be found within the framework’s settings either than within the web apps.

but have you ran into the same problem I’m in right now?

I can’t do anything at the moment without creating my first webapp.

Any ideas?

Thanks in adavnce.

Thank !