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)