1
votes

I have tried to install sfGuardPlugin for hours an still it doesn't work.

First I tried to install it this way: php symfony plugin:install sfGuardPlugin

But I get this error:

Fatal error: require_once(): Failed opening required 'PEAR.php' (include_path='/users/alex/fsp:/users/alex/fsp/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor:/users/alex/fsp/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/task:') in /users/alex/fsp/lib/vendor/symfony/lib/plugin/sfPearEnvironment.class.php on line 15

Though I've added

    include_path = ".:/php/includes:/Users/alex/Documents/PEAR/PEAR"

to the php.ini (respectively php.ini.default). This is the php.ini which I get when I use the phpinfo() function.

I've tried a lot things to get it work but then I tried to install the plugin manually. I've downloaded the package from the symfony website and unarchived it. I added

    $this->enablePlugins(array('sfPropelPlugin', 'sfGuardPlugin')); 

to the ProjectConfiguration.class.php file. Then I rebuilt the model using

    php symfony propel:build --all --and-load.

Then I changed the base class of myUser to sfGuardSecurityUser. I edited the settings.yml and added (correctly formatted :) ):

all: .settings: ... enabled_modules: [default, sfGuardAuth]   .actions: login_module: sfGuardAuth login_action: signin

After building I get this error:

Warning: require(/users/alex/fsp/plugins/sfGuardPlugin/lib/user/sfGuardSecurityUser.class.php) [function.require]: failed to open stream: Permission denied in /users/alex/fsp/lib/vendor/symfony/lib/autoload/sfAutoload.class.php on line 188

Fatal error: require() [function.require]: Failed opening required '/users/alex/fsp/plugins/sfGuardPlugin/lib/user/sfGuardSecurityUser.class.php' (include_path='/users/alex/fsp:/users/alex/fsp/lib/vendor/symfony/lib/plugins/sfPropelPlugin/lib/vendor:.:') in /users/alex/fsp/lib/vendor/symfony/lib/autoload/sfAutoload.class.php on line 188

After clearing the cache I get this error:

Fatal error: Class 'sfGuardSecurityUser' not found in /users/alex/fsp/apps/frontend/lib/myUser.class.php on line 4

The class sfGuardSecurityUser exists in plugins/sfGuardPlugin/lib/user. The tables are created in the database. Of course I also switched the is_secure entry to true in the security.yml file.

I've tried and searched and read for two days now to solve this problem but I can't get it work. Could anybody help?

Thanks, Alex

1
Did you check if Apache (or the http server you're using) have read permissions to the plugin folder and lib inside the plugin folder?Michal Trojanowski
Thanks for your answer, now it works!alex
I have added that as an answer.Michal Trojanowski

1 Answers

0
votes

It seems that your server user does have read access to the plugin folder. That's why it can't load the necessary classes. The configuration is ok.

Change the folder's permissions and it will work.