Yii Framework Forum: yiic shell works with main.php but not with index.php - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

yiic shell works with main.php but not with index.php Rate Topic: -----

#1 User is offline   Arvind 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-October 09
  • Location:Calgary, AB, Canada

Posted 10 February 2010 - 09:55 PM

Hello,

I tried doing this in the main directory of my application where index.php resides.

$ path/to/yii/framework/yiic shell index.php
$

and it came back to prompt and the shell never opened.

but when i did this
$ path/to/yii/framework/yiic shell protected/config/main.php
Yii Interactive Tool v1.1 (based on Yii v1.1.0)
Please type 'help' for help. Type 'exit' to quit.

In general the application works fine without a flaw. and index.php is valid and its able to control the application nicely.

So, i dont quite get , it, why it worked with main.php but not with index.php.

I am using
php -v
PHP 5.3.1 with Suhosin-Patch (cli) (built: Feb 3 2010 22:58:35)
Copyright © 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright © 1998-2009 Zend Technologies


thanks
Arvind
0

#2 User is offline   andy_s 

  • Random Member Title
  • Yii
  • Group: Moderators
  • Posts: 1,526
  • Joined: 22-June 09
  • Location:Russia, Kostroma

Posted 11 February 2010 - 12:49 AM

Did you try "protected/yiic shell" from the main directory of your application?
0

#3 User is offline   Arvind 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-October 09
  • Location:Calgary, AB, Canada

Posted 11 February 2010 - 12:54 AM

yes, i tried both
protected/yiic shell index.php

and
/path/to/yii/framework/yiic shell index.php

they just dont work.
it seems to like only main.php :-)

There is no error message. just the cursor returns to prompt.
is there any log that i can check ?

nothing in /var/log/messages.

Arvind
0

#4 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,340
  • Joined: 12-October 09
  • Location:Croatia

Posted 11 February 2010 - 02:20 AM

View Postandy_s, on 11 February 2010 - 12:49 AM, said:

Did you try "protected/yiic shell" from the main directory of your application?


View PostArvind, on 11 February 2010 - 12:54 AM, said:

yes, i tried both
protected/yiic shell index.php


What andy_s tryed to ask you is if you have tried "protected/yiic shell" - without index.php!
Find more about me.... btw. Do you know your WAN IP?
0

#5 User is offline   Arvind 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-October 09
  • Location:Calgary, AB, Canada

Posted 11 February 2010 - 02:29 AM

ok.. i tried
protectec/yiic shell

and same result as before. nothing happens. no error message and i return back to the prompt.
0

#6 User is offline   Mike 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 3,013
  • Joined: 06-October 08
  • Location:Upper Palatinate

Posted 11 February 2010 - 03:00 AM

Have you configured access rules that prevent to access the start page without login? If so, there's no other way to use the shell except providing the path to main.php.
1

#7 User is offline   Arvind 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 43
  • Joined: 03-October 09
  • Location:Calgary, AB, Canada

Posted 11 February 2010 - 03:10 AM

Hey Mike,

you hit the nail on the head.

yeah, my start page cannot be accessed unless you login.
so you when you try

http://localhost/myapp/

it will redirect you to
http://localhost/myapp/site/login

no wonder :-).. thanks.. you solved a big problem for me.


thanks a ton
Arvind
0

#8 User is offline   got 2 doodle 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 247
  • Joined: 12-December 08
  • Location:Beautiful Nova Scotia, Canada

Posted 11 February 2010 - 09:13 AM

View PostMike, on 11 February 2010 - 03:00 AM, said:

Have you configured access rules that prevent to access the start page without login? If so, there's no other way to use the shell except providing the path to main.php.

Awesome!, I have been experiencing exactly the same behavior and until now it has totally baffled me. As a work around I created a bogus application referencing the same DB and created my models and crud and then just copied them into the appropriate places.

Thanks Mike, it's great to know why it was broken.

doodle
Check out myYii powered website
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users