After the Java and make PHP, I am the whole person is not good =. =
With the master on Linux on the afternoon, did not tune out, in the morning ran through the windows, at noon finally on the Linux fix, hey.
Server-side configuration see here
On windows, I'm using XAMPP integrated Apache and PHP.
1. First ensure that PHP supports curl extension, guaranteed in Xampp\php\php.ini, extension=php_curl.dll in front;
2. Download the PHP client code to the CAS GitHub.
3. The path to my XAMPP project is xampp\htdocs this path, which can be configured in D:\xampp\apache\conf\httpd.conf. So create a new folder under Xampp\htdocs\ called Phpcasclient1, and copy the cas.php and CAS folders from the compressed package you just downloaded to Phpcasclient1. And the \docs\examples\example_simple.php inside the package is also copied over.
4. Locate the example_simple.php in the
Phpcas::client (Cas_version_2_0, $cas _host, $cas _port, $cas _context);
The following three items are set to the corresponding CAS server URL, port and project name, when I visit my CAS server through the URL https://sunshineatnoon.com:8443/cas/login access, Where sunshineatnoon.com is my server domain name, can be changed to the corresponding IP address or localhost. So my client function is configured as follows:
Phpcas::client (cas_version_2_0, ' sunshineatnoon.com ', 8443, ' CAS ');
Pay particular attention to this line of code in example_simple.php:
require_once $phpcas _path . '/cas.php ';
Through this line of code, example_simple.php to be able to find cas.php this file, because I just put this file in the example_simple.php in the same folder, so I changed the previous line of code to:
require_once '/cas.php ';
Of course, for the sake of insurance, you can write the absolute path of cas.php directly, it is very important to see this in the Linux configuration below.
5. Then you can access the PHP client through the browser, enter the URL: http://localhost/Phpcasclient1/example_simple.php can see the jump page of the CAS:
After logging in with the username and password in the database, I see the client's real page:
I see that most of the tutorials on the web need to install PHP pear and DB extensions, which I did not install, but did receive the following two warning:
1 require file require (): Failed opening required ' script_info.php ' (include_path= '.;D: \ Xampp\php\pear ') in D:\xampp\htdocs\Phpcasclient1\example_simple.php on line 56
Because not PHP =. =, so it is not studied in detail.
"TECH" CAS PHP Client Configuration