Home Backend Development PHP Tutorial phpGACL汉语手册(十)安装

phpGACL汉语手册(十)安装

Jun 13, 2016 am 11:01 AM
admin php smarty

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 of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1253
24
PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP vs. Python: Understanding the Differences PHP vs. Python: Understanding the Differences Apr 11, 2025 am 12:15 AM

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

PHP and Python: Different Paradigms Explained PHP and Python: Different Paradigms Explained Apr 18, 2025 am 12:26 AM

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

See all articles