thyseus / yii-user-management

a user management module collection for the yii framework
185 stars 122 forks source link

Installation driving me nuts #75

Open edwar64896 opened 11 years ago

edwar64896 commented 11 years ago

Sorry, but I have a flat spot on my forehead where I'm banging it on the desk trying to get this thing installed.

Following install_tutorial.txt to the letter, but having no luck running the installer.

Getting errors telling me the alias user.UserModule is invalid.

Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file and the file is readable.

Attempted to add a cache to main.php but this then throws a different exception telling me the cache property is read-only.

I"m using latest yii (1.1.13) and gitclone latest yum. php is 5.3.3

I would be most grateful if you would be able to provide some guidance to getting this puppy walking.

thx,

Mark.

thyseus commented 11 years ago

did you extract the archive directly under the modules/ directory? it has to look like this:

modules/user/... modules/role/....

can you show me config/main.php via a gist (without passwords), so i can check if the cache is set at the correct place?

edwar64896 commented 11 years ago

yup. archive directly under protected/modules...

https://gist.github.com/4452884

edwar64896 commented 11 years ago

Uncommenting the cache command causes yii to freak. Tells me that the cache property is read-only.

thyseus commented 11 years ago

please place the 'cache' array under the 'components' array.

not sure about the "alias user.UserModule is invalid." though....

edwar64896 commented 11 years ago

ok will do that right now....

edwar64896 commented 11 years ago

Property "CWebApplication.cache" is read only.

edwar64896 commented 11 years ago

I did note that some of the cloned files are DOS formatted. I have done a repository-wide dos2unix on them, but this hasn't made any difference. Might be worth going through the repo on your end...

edwar64896 commented 11 years ago

ok apologies - I get what you are trying to say... cache array should be "within" the components array as opposed to above or below it. Semantics thing. I have the cache command now "within" the components array.

the WebApplication.cache errors has gone away, but the issue with the user.UserModule alias remains.

thyseus commented 11 years ago

please double-check the files are extracted correctly. the error message says, that the aren't. show me a directory listing to make it safe, please ;)

AMilkov commented 11 years ago

Where you placed the YUM module? Can you send the output of: "ls -la" in your protected/modules dir?

edwar64896 commented 11 years ago

https://gist.github.com/4453301

PrplHaz4 commented 11 years ago

See this comment, it may be due to short tags - I have seen this issue come up a few times in the chat room as well:

https://github.com/thyseus/yii-user-management/issues/27#issuecomment-10927940

edwar64896 commented 11 years ago

probably should have mentioned that I have tried fixing the short tags as well.

UserModule.php has a short tag, and a missing end tag. So I put in the missing end tag and replaced the long tag. For safety, I also added the short_tag directive in the .htaccess file.

Still makes no difference.

PrplHaz4 commented 11 years ago

to fix the short tags you shouldn't have to do anything but enable them....I would back out any other changes (besides PHP short tag directive) and see if that works

edwar64896 commented 11 years ago

At the moment, I'm starting again from scratch so I'll post again when I have a result. Am also trying other framework versions to see if something broke in a yii update.

edwar64896 commented 11 years ago

Have created a new skeleton project and had some success now. Will try and work out where the differences between the two projects are. First project had a couple of models, but nothing too hard - nothing that would justify the results I was getting. Anyway, managed to run the installer now, albeit under 1.1.12 yii.

Observations:

  1. git clone results in a lot of files that are DOS formatted.
  2. UserModule.php has a short opening tag and no end tag.

As you do, I suspect user error, but I'll need to do some more digging to find out where.

edwar64896 commented 11 years ago

OK. I have completely stripped yii-user-management out of the original project and re-downloaded from GIT. previously I had cloned it to a user directory and then moved the submodules directly into protected/modules. This time, I am git cloning directly into "protected" and then changing the name of the git repository from yii-user-management to "modules". Shouldn't make a difference, but then these things are sent to try us.

I'm moving onwards now. I still can't quite put my finger on exactly what the issue is, but there appears to have been some sort of filesystem issue causing this problem. Anyways, water under the bridge now. I'm installing, and moving on.

FYI, I'm doing the following so far to get things working:

  1. cd to $WEBAPP/protected/modules
  2. chown -R apache:apache *
  3. find . ! -type d | xargs dos2unix
  4. Adding the following .htaccess into $WEBAPP
php_flag short_open_tag on

with the short tags on, the missing end tag in UserModule.php doesn't seem to make a difference either way.

thx.

thyseus commented 11 years ago

Hmm, unfortunately i still have no idea why this happens. Yum has the convention to use short php tags for development and <?php in production releases (yes, yes its time again...) You can try to recursively replace <? with <?php but i really doubt that will fix your problem.

please let me know if you find something !

maisondx commented 11 years ago

this looks very promising but, I am getting the same read only error. What was the resolution?

maxi032 commented 11 years ago

I am on xampp and received all kinds of errors like: "alias user.UserModule is invalid" and many more. It seems that my problems have been solved by using long php tags. I have to make the change in almost all the files in /controllers, /models