我需要专家提供一些关于如何使用 MySQL 开发 PHP 网站的建议
我需要专家的一些建议:) 我将使用 PHP 开发一个网站,还将使用 MySQL。我从虚拟专用服务器购买了一些服务器空间,包括所需的所有服务。
我应该如何开发网站?我应该在家里的机器上开发它(例如使用 Wamp),并在准备好后将所有文件传输到服务器吗?如果是这样,传输数据库的最佳方法是什么?
提前致谢!!
I need some advice from experts :)
I will develop a website using PHP and I will use also MySQL. I bought some server space from a Virtual private server including all the service needed.
How should I develop the site? Shall I develop it on my machine at home (using for example Wamp), and when ready transfer all the files to the server? If so what is the best method to transfer also the database?
Thanks in advance!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
linky:
初学者
和 MySQL
编辑:
关于开发服务器:
您的网站主机从不关心如何开发应用程序,他们不能或永远不会为此目的提供开发工具、技术或空间。他们仅托管您的应用程序。所以,这是你的问题
是的,因为如果您想自己动手,这是您唯一的选择。最好的方法是(恕我直言),在您的
开发机器
上开发应用程序,然后在另一台机器(
,其服务器
)上进行测试规范
与您的商业网络主机
最接近
/code> 祝你好运。
linky:
Beginner
and MySQL
EDIT:
About Development Servers:
your Webhost is never bothered about how you develop your application, neither thay can provide or will ever provide development tools, technologies or space for this purpose. They only host your Application. So, It is your problem
Yes, because it is the only option you have if you want to do it yourself. The best way to do this is (IMHO), develop the application on your
development machine
, andtest
it on a another machine (server
) with thespecification
,nearest
to the one yourcommercial webhost
has.Best of luck
在本地服务器上进行开发应该更快,因为您可以“实时”预览所有更改,而无需将更新的文件上传到托管服务器。所以是的,我建议在本地工作。我自己用的是Wamp。
至于数据库,您可以在 PHPMyAdmin(随 Wamp 附带)中导出它。它应该生成一个巨大的查询(实际上是一组查询),然后您可以在站点上执行该查询以创建表并填充内容。
Developing on a local server should be faster since you can preview all the changes "live", without uploading the updated files to the hosted server. So yeah, I'd recommend working locally. I use Wamp myself.
As for the database, you can export it in PHPMyAdmin (ships with Wamp). It should generate a gigantic query (a set of queries, actually), which you can then execute on your site to create the tables and fill them with content.
最好的方法是保留两台服务器。一种是您的生产环境(购买的环境安装在某个机架上)。第二个是你的开发环境(运行Linux的虚拟机,基本上是生产服务器的副本)。
您应该使用任何让您满意的编辑器/IDE 在家进行开发(我推荐 PHPDesigner)。 MySQL Workbench 非常适合创建/编辑 MySQL 数据库。
复制更改就像文件的 rsync 和表的 MySQL 表导出一样简单。
我还建议在开发计算机上运行 SubVersion 服务器,以便您可以保留工作的最新修订(即使您独自完成)。
Best method is to keep two servers. One is your production environment (the purchased one mounted in some rack somewhere). The second is your development environment (virtual machine running Linux, basically a copy of the production server).
You should be doing your development at home using whatever editor/IDE makes you happy (I recommend PHPDesigner). MySQL Workbench works great for creating/editing your MySQL database.
Copying changes over is as easy as rsync for the files and MySQL Table Export for the tables.
I also recommend running a SubVersion server on the Development machine, so you can keep dated revisions of your work (even if you are doing it alone).
这取决于您的家庭设置。有一种方法可以导出 MySQL 数据库,因此如果您选择这种方法,您将能够传输数据库。拥有像 PHPMyAdmin 这样的东西使这变得更加简单(XAMPP 中默认存在,如果您还没有设置,我建议将其用于家庭服务器)。
It depends on your home setup. There is a way to export MySQL DBs, so you'll be able to transfer the database if that's the route you take. Having something like PHPMyAdmin makes this a lot simpler (comes default in XAMPP, which I would recommend using for a home server if you haven't set one up already).