search
HomeBackend DevelopmentPHP Tutorial phpGACL汉语手册(十)安装

phpGACL中文手册(十)安装

前面已经把phpGACL的概念和如何进行权限控制简单的阐述了一遍,从这一章开始,写的是如何对phpGACL进行安装,安装分两种,基本安装和高级安装,下面我就来作个阐述。
安装
基本安装
1将 .tar.gz 文件解压至你网站的根目录或子目录中,你可以将其重命名为你认为适合的名字。
2你可以用你喜欢的编辑器来编辑 phpgacl/gacl.class.php,gacl.inc.php 文件,并设置其中你将用到的 db_type, db_host, db_user, db_password 和 db_name 变量
现在将phpgacl/admin/gacl_admin.inc.php 文件中保持相同的信息。该文件不仅被安装脚本而且还将被 ACL 管理后台调用。

将两个文件保持相同信息的原因在于 ACL 核心库文件 gacl.class.php 比全部的 API 类文件要小得多,没有必要在你只想调用 acl_check() 文件时包含进全部代码。

在服务器上创建你在 db_name 变量中指定的数据库(以 MySQL 为例)

在浏览器中输入网址 http:// 你的站点 /phpgacl/setup.php 。被要求的表单将被建立在你创建的数据库中。不必担心会看到一堆的输出,如果正常运行的话,你将只会看到成功信息。

现在按照最后在屏幕上出现的建议创建 phpgacl/admin/templates_c 目录。它必须是可以被 WEB 服务器用户写入的。如果你不能做到这一点,那么你将不能使用 CAL 管理!
点击成功安装页面底部的链接或直接在浏览器中输入网址: http://yoursite.net/phpgacl/admin/acl_admin.php

高级安装
重新使用已有 ADOdb 的安装方法
如果你已经使用了 ADOdb ,你可以使 phpGACL 使用该 ADOdb 拷贝。
1编辑 phpgacl/gacl.class.php 文件,将 ADODB_DIR 变量设置为 ADBdb 库所在的目录。
2将 phpgacl/adodb 目录重命名为其它名字如 adodb_x ,然后重新载入网页 phpgacl/admin/acl_admin.php ,以确保其能正常工作。
3删除随 phpGACL 安装的 adodb 目录。


重新使用已安装的 Smarty
1编辑 phpgacl/admin/gacl_admin.inc.php 文件,以便变量 $smarty_dir 和 $smarty_compile_dir 能指向已安装 Smarty 库所在位置,并且 template_c 目录你正在使用。
将 phpGACL 模板目录移至另一个目录(比如上级目录中),调整变量 $smarty_template_dir 使之指向新的位置。当然如果你愿意,你也可以将这些模板移到已存在的模板目录中。
2将 phpgacl/smarty 目录重命名为其他名称(如 smarty_x )并重新载入 phpgacl/admin/acl_admin.php 页,以确保它能正常工作。
3删除随 phpGACL 安装的 smarty 目录


我怎样将phpGACL文件移出网站目录,同时在该目录中留下一个链接以便管理呢?
1进入你的网站根目录
2将phpGACL目录移入你的includes目录,同时创建一个软链接到管理工具目录。
mv phpgacl/ /www/includes_directory
ln -s /www/includes_directory/phpgacl/admin/ gacl
3现在输入网址:http://yoursite.net/gacl/acl_admin.php,进入管理页面。如果页面没有正常显示,请确认你的网站服务器允许在网站目录中存在软链接。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
php怎么把负数转为正整数php怎么把负数转为正整数Apr 19, 2022 pm 08:59 PM

php把负数转为正整数的方法:1、使用abs()函数将负数转为正数,使用intval()函数对正数取整,转为正整数,语法“intval(abs($number))”;2、利用“~”位运算符将负数取反加一,语法“~$number + 1”。

php怎么实现几秒后执行一个函数php怎么实现几秒后执行一个函数Apr 24, 2022 pm 01:12 PM

实现方法:1、使用“sleep(延迟秒数)”语句,可延迟执行函数若干秒;2、使用“time_nanosleep(延迟秒数,延迟纳秒数)”语句,可延迟执行函数若干秒和纳秒;3、使用“time_sleep_until(time()+7)”语句。

php怎么除以100保留两位小数php怎么除以100保留两位小数Apr 22, 2022 pm 06:23 PM

php除以100保留两位小数的方法:1、利用“/”运算符进行除法运算,语法“数值 / 100”;2、使用“number_format(除法结果, 2)”或“sprintf("%.2f",除法结果)”语句进行四舍五入的处理值,并保留两位小数。

php怎么根据年月日判断是一年的第几天php怎么根据年月日判断是一年的第几天Apr 22, 2022 pm 05:02 PM

判断方法:1、使用“strtotime("年-月-日")”语句将给定的年月日转换为时间戳格式;2、用“date("z",时间戳)+1”语句计算指定时间戳是一年的第几天。date()返回的天数是从0开始计算的,因此真实天数需要在此基础上加1。

php怎么判断有没有小数点php怎么判断有没有小数点Apr 20, 2022 pm 08:12 PM

php判断有没有小数点的方法:1、使用“strpos(数字字符串,'.')”语法,如果返回小数点在字符串中第一次出现的位置,则有小数点;2、使用“strrpos(数字字符串,'.')”语句,如果返回小数点在字符串中最后一次出现的位置,则有。

php字符串有没有下标php字符串有没有下标Apr 24, 2022 am 11:49 AM

php字符串有下标。在PHP中,下标不仅可以应用于数组和对象,还可应用于字符串,利用字符串的下标和中括号“[]”可以访问指定索引位置的字符,并对该字符进行读写,语法“字符串名[下标值]”;字符串的下标值(索引值)只能是整数类型,起始值为0。

php怎么设置implode没有分隔符php怎么设置implode没有分隔符Apr 18, 2022 pm 05:39 PM

在PHP中,可以利用implode()函数的第一个参数来设置没有分隔符,该函数的第一个参数用于规定数组元素之间放置的内容,默认是空字符串,也可将第一个参数设置为空,语法为“implode(数组)”或者“implode("",数组)”。

php怎么查找字符串是第几位php怎么查找字符串是第几位Apr 22, 2022 pm 06:48 PM

查找方法:1、用strpos(),语法“strpos("字符串值","查找子串")+1”;2、用stripos(),语法“strpos("字符串值","查找子串")+1”。因为字符串是从0开始计数的,因此两个函数获取的位置需要进行加1处理。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools