我如何为网站创建安装程序.php mysql [英] How I can create installer for website. PHP mysql

查看:30
本文介绍了我如何为网站创建安装程序.php mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站.

我需要知道如何为此站点创建安装程序.这意味着当用户第一次将网站上传到他们的主机时,他们可以选择插入数据库详细信息.

I need to know how i can create a installer for this site. Meaning when user upload the site on to they host first time they get option to inset they database details.

用户插入他们的数据库详细信息,然后他们在 config.php 文件中更改.

User insert they database details which then they change in config.php file.

我也有我喜欢运行查询的 tables.sql

also i have tables.sql which i like to run query

我尝试使用

$text = file_get_contents();

但是我的查询失败了,因为我有大约 32 个表,我需要插入数据库和所有必要的设置.

but my querys fails as i do have around 32 tables i need to inset into database and all the necessary setting.

推荐答案

有许多工具旨在实现这一目标,具有不同的功能集:

There is a number of tools that aim to achieve this, with different feature sets:

这些是从 cweiske

如果您不需要通用工具,最简单的方法是编写一个简单的安装脚本并要求用户运行它.这可以像打印表单并询问所需详细信息的单个文件一样简单.提交后,执行必要的安装程序.

If you dont need a generic tool, the easiest would be to write a simple install script and ask users to run it. This can be as easy as a single file that prints a form and asks for the required details. When submitted, do the necessary install routines.

这篇关于我如何为网站创建安装程序.php mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆