search
Homephp教程php手册ZenTaoPHP部署框架自带的简单的blog示例

ZenTaoPHP框架中自带了一个简单的blog示例,下面让我们来部署这个示例应用。

一、创建数据库

在app/demo/db目录下面,有一个blog.sql。这是一个非常简单的表结构,使用phpmyadmin,或者是命令行的mysql工具,创建一个数据库,叫做blog,然后把这个sql文件里面的建表工具导入。

$> mysql -u root -p
$> create database blog;

 

二、创建应用的配置文件

在我们的代码中,已经内置了一个config.php文件,可以直接修改这个配置文件,但是我们建议的方式是创建一个my.php,将当前应用相关的配置在这个my.php文件中重新定义。这样可以解决代码冲突的问题。

将app/demo/config/my.example.php文件,复制为my.php,然后修改其中的数据库访问参数。

$config->debug = true;                      // 开发环境,可以将debug打开。
$config->requestType = 'PATH_INFO'; // 如果apache打开了mod_rewrite,可以用这个选项。如果不行,则改用GET
$config->requestFix = '-';                   // 路径分隔符。
$config->webRoot = '/zentaophp/app/demo/www/';    // 当前应用的根路径,也就是index.php所在的路径。

$config->db->host = 'localhost';
$config->db->port = '3306';
$config->db->name = 'blog';
$config->db->user = 'root';
$config->db->password = '';

三、访问blog应用。

http://localhost/zentaophp/app/demo/www/blog,即可看到界面了。

(作者:禅道)



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

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

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Atom editor mac version download

Atom editor mac version download

The most popular open source editor