oncesk / yii-node-socket

66 stars 46 forks source link

Yii2 server is not starting throws name space error #65

Open abeersaeed opened 9 years ago

abeersaeed commented 9 years ago

capture I have followed all the steps you have mentioned but when i try to run the server using console it throws this error can you please check it and let me know. I have used your extension in Yii 1 now i want to use this in Yii 2 but i am stuck looking forward to listen from you Regards

abeersaeed commented 9 years ago

I am using Yii2 advance templete

oncesk commented 9 years ago

Hi, did you added comand to command map in configuration?

Отправлено с моего Xiaomi

Сообщение от "abeersaeed notifications@github.com":

I am using Yii2 advance templete

— Reply to this email directly or view it on GitHub.

abeersaeed commented 9 years ago

capture Yes i did

abeersaeed commented 9 years ago

I added it in console/config/main

oncesk commented 9 years ago

So, problem in configuration, i will think and let you know, you please too

Отправлено с моего Xiaomi

Сообщение от "abeersaeed notifications@github.com":

I added it in console/config/main

— Reply to this email directly or view it on GitHub.

abeersaeed commented 9 years ago

yeah sure i am looking into it and please you also let me know Thanks

oncesk commented 9 years ago

Can you look at all available yii command, is there yiinodesocket command?

Отправлено с моего Xiaomi

Сообщение от "abeersaeed notifications@github.com":

yeah sure i am looking into it and please you also let me know Thanks

— Reply to this email directly or view it on GitHub.

abeersaeed commented 9 years ago

capture i tried to include it using Require in config now i am getting Unknown component Id

oncesk commented 9 years ago

hi, can you show your configuration console/config/main.php?

abeersaeed commented 9 years ago

capture Here It is

oncesk commented 9 years ago

so, you set a wrong type to array_merge

require function can return some value from required file if in file used return statement array_merge used for merging arrays but in your case last require return nothing

you need to remove last require in array_merge statement and add node-socket configuration to components something like this only your configuration

'nodeSocket' => [
            'class' => '\YiiNodeSocket\NodeSocket',
            'host' => 'localhost',
            'allowedServerAddresses' => [
                "localhost",
                "127.0.0.1"
            ],
            'origin' => '*:*',
            'sessionVarName' => 'PHPSESSID',
            'port' => 3001,
            'socketLogFile' => '/var/log/node-socket.log',
        ],
oncesk commented 9 years ago

you can add nodeSocket to bootstrap

'bootstrap' => ['log', 'nodeSocket'],
abeersaeed commented 9 years ago

oh ok let me try

abeersaeed commented 9 years ago

capture Still it says

abeersaeed commented 9 years ago

Unable to find \YiiNodeSocket\NodeSocket

oncesk commented 9 years ago

So, read error message and check your syntax

Отправлено с моего Xiaomi

Сообщение от "abeersaeed notifications@github.com":

 Still it says

— Reply to this email directly or view it on GitHub.

abeersaeed commented 9 years ago

I have fixed the above issue the main issue is not able to find \YiiNodeSocket\NodeSocketCommand which is the main class for Socket Command

oncesk commented 9 years ago

do you have some errors? Is server starting?

oncesk commented 9 years ago

if you used composer and include vendor/autoload.php into your project all should works

abeersaeed commented 9 years ago

no server is not starting when i try to start the server by yii node-socket/start it throws error which i have shared with you

oncesk commented 9 years ago

you need to check your configuration. NodeSocket extension must be configured like any other extension installed with composer

oncesk commented 9 years ago

i do not know how i can help you with it because i do not see you project and etc...