I installed the phpCAS package in my server like so:
pear install http://www.ja-sig.org/downloads/cas-clients/php/1.0.1/CAS-1.0.1.tgz
I then downloaded the CAS module for Drupal and attempted to activate it, but received the following error:
Fatal error: require_once() [function.require]: Failed opening required 'CAS/CAS.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/drupal/sites/all/modules/cas/cas.module on line 9
Further investigation showed that the CAS.php file is located at /usr/share/php/CAS.php, so I edited the cas.module file and removed the "CAS/" prefix from the require statement path. After that, the module worked fine.
Is this something that needs fixing?
Thanks!
Comments
Comment #1
bassglider commentedI have the same problem
Comment #2
metzlerd commentedI wasn't aware that cas had become available on the pear site. The module sort of assumes you downloaded it manually. I'll try and give this some thought, but there's a pretty big install base that has the cas module installed the other way. I don't want to break it for them. Open to elegant ideas. I suppose I could test for the /usr/share/php but this seems distibution specific. Anyone have some good ideas on how to solve this in a non distribution specific way?
Comment #3
aniaclug commentedI've done like this:
changed line 9 to:
added function _cas_get_CAS_location as follows:
Sorry for the indenting...
It works searching CAS.php in the include_path directories first as path/CAS.php then as path/CAS/CAS.php
It saves the results in a db variable for future references.
This could also be done in the install process letting the module only to load the db variable.
Comment #4
metzlerd commentedI like this as a general concept, but I think I'll want to add this to the CAS settings page so that the user could override it. It could be problematic if things move. I like your detection mechanism for the default, though. If you're willing to tackle the UI, feel free to submit a patch :)
Comment #5
TimG1 commentedI just tried downloading and installing the CAS module for the first time too. Downloaded from this URL following the readme. http://sourceforge.net/project/showfiles.php?group_id=88445
I tried putting this in sites/all/modules/cas/ and sites/all/modules/cas/CAS and am getting the same "cas.module on line 9" error.
Am I putting this in the right place?
-Tim
Comment #6
metzlerd commentedI think so CAS.php should be in a folder called CAS that is somewhere in your include path. So inside sites/all/modules/cas you should have a folder CAS, and a CAS.php file in that folder. Does that make sense?
Dave
Comment #7
TimG1 commentedHi Dave,
Thanks for the reply. Yeah, that makes sense. I gave that a try and I still get the "Error in line 9 of cas.module". But, I wound up getting it to install okay (I think?)
I got my host to put CAS on my "include path" location....include_path='.:/usr/share/php:/usr/share/pear in the case of the first poster here.
I then got a different error about DB.php and got rid of it after I did this: http://drupal.org/node/192537
It then installed successfully. But, I still can't get CAS login to work for me. I don't know if I am not using/configuring it correctly or what. I'm not exactly sure what's supposed to happen next. But, that's a separate issue, haha! I'll start a different thread for that.
Thanks!
-Tim
Comment #8
stuffnthings commentedI took the "source" folder from the phpcas-0.6.0-1 download and put the contents in a folder named CAS inside the sites/all/modules/cas folder. This worked for me.
Comment #9
Petrica commentedSame here
Comment #10
realityloop commentedI've just created patches for adding Libraries API support, can we add that to this?
Add libraries API support
http://drupal.org/node/857954#comment-3415638
Comment #11
metzlerd commentedLibrary support was added with the following issue.
#857954: Add setting to configure the location of the phpCAS directory