yiic webapp ../testdrive does nothing on my Windows 7

When I issue any of these from the Windows 7 command prompt within the framework directory, nothing happens. No error messages. No application files get created.

yiic webapp ../testdrive

yiic.bat webapp ../testdrive

php yiic.php webapp ../testdrive

php.exe (5.2.10) is in path.

Requirements shows no red fails.

What should I look at next?

Did you try backslashes \ instead of slashes / for the path?

Yep… I tried slashes both ways.

Still nothing.

Did you add the yii directory to your path?

You should be in the yii/framework/ directory when running the yiic command.

From the framework directory, the command line should be:

yiic webapp ../../testdrive

I didn’t have the yii directory in my path for several reasons… the README doesn’t say I need it, there are no executable files in the yii directory, and there shouldn’t need to be a dependency like that if running yiic from within a framework directory (it would be a pain to develop multiple yii apps if every one had to be in the path).

However, I went ahead and added the framework directory to the path and restarted my console and it still doesn’t work… no matter which direction I do the slashes and no matter what I specify the destination path to be. yiic returns no errors, no info at all.

Maybe this will help you: cookbook article

I’m running yii on my home desktop, laptop and workstation where I work. It’s running fine on all three machines. All are running the latest Windows 7 updates.

There is a cookbook article about setting up yii on wamp for Windows XP/Vista. It also works with Windows 7. Two paths are added–one for the yii framework directory and the other for the php directory. In my case, I’m running the xampp stack from Apache Friends instead of wamp. Use the cookbook article as a set of guidelines. If you have not already tried to, download another copy of yii and reinstall it.

If your PDO driver extensions are not enabled in php.ini, yiic may be bailing out with no error. The application created by yiic needs the PDO extensions to access the SQLite database included in the protected/data/ directory of the skeleton application. If the creation path used in the yiic command line is not a relative path, to your local web directory, yiic could create the skeleton application in another directory (e.g., in the yii directory or elsewhere).

With yiic, I always use forward slashes as directory separators. As I recall, yiic does not like back slashes.


Once you get the webapp generation problem solved and it comes to running yiic from the <application>/protected/ directory, you may need to change the relative path in <application>/protected/yiic.php to reflect the location of your yii directory (read the comment on the top of the file). You may need to do this to get the yiic shell command to run.

Nope. Even when I add the location of the php.ini to the command line using php -c, it still doesn’t work. I get the location of the php.ini file from the passing /requirements/ webroot (running php_info()).

So… this doesn’t work either:

php -c C:\php\php.ini yiic.php webapp …\…\testdrive

With slashes either way.

No output from the command line.

Just noted that you wrote: php.exe is in path.

Just to make sure: It should be the directory which contains php.exe that should be in your path…

Right. Php.exe is in the path because I added the folder/directory that contains the php binary to the environment path string.

Have you tried:

php -v (which should confirm your php version)?

Or what about running the Command-prompt with Administrator privileges (run as Administrator)?

Just a wild guess :slight_smile:

Yep. Tried all of that. PHP version is fine. Running with escalated admin privileges doesn’t help.

SOLVED.

I decided to stop playing around and attempt to debug the framework. It didn’t take too long to realize what was up.

yiic includes yii.php which I thought would be the base framework… but in my yii.php file there was nothing but a "Message Translations" array. Downloading the nightly snapshot of yii showed me that the yii.php SHOULD contain the bootstrap file that loads up the YiiBase class.

Ahem.

So, I just copied the yii.php file from the nightly snapshot to replace the one I had and everything is now working.

As I recall, I downloaded 1.1.0 Stable ZIP archive. But when I just downloaded it again and checked it, the yii.php file is as it should be. So… it seems like the archive contained the wrong file at some point but now has the correct file… or something overwrote the file. In any case… if any of you have this issue, check to make sure your framework/yii.php file is correct.

Something must be wrong with your installation.

I have just tried the following on a fresh installation of Windows 7:

  1. Download WampServer from wampserver.com

  2. Install wamp-server to d:\wamp

  3. Inserted path to php: d:\wamp\bin\php\php5.3.0

  4. Download yii-framework 1.1.0

  5. Copy framework-folder and requirements-folder to d:\wamp\www (webroot)

  6. Open localhost and check requirements: http://localhost/requirements

  7. Open command prompt in framework-folder

  8. yiic webapp …\testdrive

Webapplication generated successfully…

Actually… if you are having this problem go ahead and download a whole new archive and just start over. I’m finding other weird things, too. Like when I generate a webapp using yiic, the index.php file generated is a view rather than a bootstrap file. I think I just got a hosed version.