createUrl from console outputting full path

Hi guys,

I’m currently writing an app for the console to send emails with the websites URL in it.

When I execute the script from the command line the createUrl() url path is always the path from where I’m executing the script.

So the url might be:

and I want it to be:

I want to be able to run the script from any folder and have it just output the url I need


check these 2 posts


i cant get to execute the following url in my console app

echo Yii::app()->createAbsoluteUrl(‘RunActionsController/run’);

It merely echos the url (which is correct)… but how do i execute it?

Please help…


I kinda solved this with the yii httpclient extension.

It executed. Thanks.