Simple Blog example with zentaophp deployment framework

Source: Internet
Author: User

With a simple blog example in the zentaophp framework, let's deploy this example application.

First, create a database

Under the app/demo/db directory, there is a blog.sql. This is a very simple table structure, using the phpMyAdmin, or the command line of the MySQL tool, create a database called blog, and then the SQL file inside the Table tool import.

$> Mysql-u Root-p
$> CREATE Database blog;

Second, create the application of the configuration file

In our code, a config.php file has been built in to directly modify the configuration file, but the way we recommend it is to create a my.php that will redefine the current application-related configuration in this my.php file. This solves the problem of code conflict.

Copy the app/demo/config/my.example.php file to my.php, and then modify the database access parameters therein.

$config->debug = true; Development environment, you can open debug.
$config->requesttype = ' path_info '; If Apache opens the Mod_rewrite, you can use this option. If not, use get
$config->requestfix = '-'; The path separator character.
$config->webroot = '/zentaophp/app/demo/www/'; The root path of the current application, which is the path where the index.php resides.

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

Third, visit the blog application.

Http://localhost/zentaophp/app/demo/www/blog, you can see the interface.

(Author: Zen Road)



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.