我在Tomcat6中安装了CAS3.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>发布于 2014-09-13 06:16:36
同样的事情也发生在我身上。在我的测试服务器上,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发布于 2014-09-16 18:26:43
我已经解决了这个问题。这个问题需要在ubuntu中安装php5-curl:
apt-get install php5-curl
https://stackoverflow.com/questions/25758356
复制相似问题