我在Tomcat 6中安装了CAS 3.4.12,使用OpenLDAP,openssl .. 我尝试应用phpCAS,但我得到空白页.. 和浏览器中的URL:
http://sso.jarkom.com/index.php?ticket=ST-7-nqIcVhNfOwPDVDRodaEK-cas
任何人都可以帮我找到错误并解决它...... ??
这是示例phpCAS的源代码
<?php
// import phpCAS lib
include_once('CAS.php');
phpCAS::setDebug();
// initialize phpCAS
phpCAS::client(CAS_VERSION_2_0,'sso.jarkom.com',443,'cas');
// no SSL validation for the CAS server
phpCAS::setNoCasServerValidation();
// force CAS authentication
phpCAS::forceAuthentication();
// logout if desired
if (isset($_REQUEST['logout'])) {
phpCAS::logout();
}
// for this test, simply print that the authentication was successfull
?>
<html>
<head>
<title>phpCAS simple client</title>
</head>
<body>
<h1>Successfull Authentication!</h1>
<p>the user's login is <b><?php echo phpCAS::getUser(); ?></b>.</p>
<p>phpCAS version is <b><?php echo phpCAS::getVersion(); ?></b>.</p>
<p><a href="?logout=">Logout</a></p>
</body>
</html>
答案 0 :(得分:0)
我发生了同样的事情。在我的测试服务器上,phpCAS工作得很好,但是在生产服务器上它停在了它为你做的那个地方。
我无法访问PROD服务器上的apache日志,因此我必须将以下内容添加到.htaccess文件中,以便将错误转储到浏览器:
php_flag display_errors 1
一旦我这样做,我收到以下错误:
Fatal error: Class 'DOMDocument' not found in /path/to/CAS-1.3.3/CAS/Client.php on line 3130
事实证明,php DOM模块安装在我的测试服务器上,但没有安装在生产环境中。如果您在Apache日志中或使用该php_flag设置的浏览器中看到该错误,那么请执行此操作(当然仅限RHEL / CentOS)。
yum install php-xml
答案 1 :(得分:0)
我已经解决了这个问题.. 这个问题需要安装php5-curl 在ubuntu:
apt-get install php5-curl