thinkphp installation guide
If you still don’t know what installation guide is;
Then download the project first; put it in the php environment and run it and you will know;
Sample project: https://github.com/baijunyao/thinkphp-bjyadmin
Why does our program need an installation guide?
1. There is an installation guide; we don’t need to explain at length how to import sql files; how to change configuration items;
2. You can write some copyright or instructions for use;
3. You can do some tests on the environment first;
Here is a simple installation and guidance process tailor-made for thinkphp purely by hand;
Of course; more importantly; this installation can be independent of thinkphp;
If you want to use it in other projects; it can also be transplanted very conveniently;
Copy the directory; add a few lines of code and you’re done;
1: Import the installation boot program
/Public/install/
Put the install in the directory of your project;
The important thing inside is bjyadmin.sql. This is the database file;
And in the initial state; there is no install.lock file;
Two: Check whether /index.php<br> is installed
// Check whether it is a new installation<br>
if(file_exists("./Public/install") && !file_exists("./Public/install/install.lock")){<br>
//Assembly and installation url<br>
$url=$_SERVER['HTTP_HOST'].trim($_SERVER['SCRIPT_NAME'],'index.php').'Public/install/index.php';<br>
// Use http:// domain name to access; avoid ./Public/install path compatibility and other errors<br>
Header("Location:http://$url");<br>
die;<br>
}
In the entry file; added a piece of code to detect whether it is installed;
Three: Process
First; when accessing index.php;
The above code will be executed first; determine whether the /Public/install/install.lock file exists;
If it does not exist; it means it has not been installed yet;
It will be redirected to /Public/install/index.php to follow the installation program;
When the database account and password are entered as required and the installation is successful;
A /Public/install/install.lock file will be created;
When accessing the entry file again; the redirection will be skipped;
At the same time, the entered database account password will be written to the /Application/Common/Conf/db.php file;
This is also a summary of thinkphp’s directory structure design experience http://baijunyao.com/article/60 in this article;
The reason why you need to create a separate db.php file;
The installation process is written in the /Public/install/index.php file;
But I don’t plan to introduce it in this article, because... I am too lazy to write;
Detailed comments have been given inside; just look at the source code;

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

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

Hot Article

Hot Tools

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.

SublimeText3 Chinese version
Chinese version, very easy to use

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

Zend Studio 13.0.1
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
