I am not good at all. I had a hard time with the master on linux for one afternoon. I didn't call it out. I ran it on windows in the morning and finally got it done on linux at noon. Hey hey. For server configuration, see here on windows. I use Apache and PHP integrated with xampp. 1. Make sure that php supports curl extension.
After java and php, I am not good at all =. = I spent one afternoon with the master on linux. I didn't call it out. I ran it on windows in the morning and finally got it done on linux at noon. For server configuration, see here on windows. I use Apache and PHP integrated with xampp. 1. Make sure that php supports curl extension.
After java and php, I am not good at all =. =
I had a hard time with the master on linux for one afternoon. I didn't call it out. I ran it on windows in the morning and finally got it done on linux at noon. Hey hey.
For server configuration, see here
On windows, I use Apache and PHP integrated with xampp.
1. Ensure that php supports curl extension, which is ensured in xampp \ php. ini; prefix extension = php_curl.dll; remove.
2. Download the php client code from CAS github.
3. The path of my xampp project is xampp \ htdocs, which can be configured in D: \ xampp \ apache \ conf \ httpd. conf. Create a new folder named Phpcasclient1 under xampp \ htdocs \ and copy the CAS. php and CAS folders in the downloaded package to phpcasclient1. And copy \ docs \ examples \ example_simple.php In the compressed package.
4. Go to example_simple.php.
phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context);
Set the following three items as the corresponding cas server URL, port and project name. When I access my cas server, it is accessed through the URL https://sunshineatnoon.com: 8443/cas/login, here, sunshineatnoon.com is my server domain name, which can be changed to the corresponding IP address or localhost. Therefore, my client function configuration is as follows:
phpCAS::client(CAS_VERSION_2_0, 'sunshineatnoon.com',8443, 'cas');
Pay special attention to this line of code in example_simple.php:
require_once $phpcas_path . '/CAS.php';
Through this line of code, example_simple.php should be able to find the CAS. php file, because I just put this file in the same folder of example_simple.php, so I changed the previous line of code:
require_once '/CAS.php';
Of course, to ensure security, you can directly write the absolute path of CAS. php. This is very important in the linux configuration below.
5. Then you can access the php client through a browser. Enter the URL: http: // localhost/Phpcasclient1/example_simple.php to view the cas jump page:
After logging on with the username and password in the database, you can see the real page of the client:
I think most of the tutorials on the Internet require the installation of php pear and db extensions. I didn't install them here, but I did receive the following two warnings:
1 Warning: require(script_info.php): failed to open stream: No such file or directory in D:\xampp\htdocs\Phpcasclient1\example_simple.php on line 56 2 Fatal error: 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 php = is not used. =, So I will not study it carefully.