有哪些方法可以简化 Linux 以及 Windows 上的 php 应用程序的安装?
我有一个 php 应用程序( http://github.com/tchalvak/ninjawars ),本质上是一个 php我在 http://ninjawars.net 运行的基于网页游戏。我经常为自己配置和安装应用程序以进行本地主机开发,这是一个有点反复试验的过程。现在我已经开源了该应用程序,一些用户希望安装它并进行编辑、提交补丁等,我想让他们尽可能简单。
我听说过 Ruby Gems,我认为它是一种 Ruby 应用程序的包管理系统。 php 有类似的有用的东西吗?否则,我应该怎样做才能使安装尽可能简单?
现在我认为安装过程的总体思路可能很简单:
All Deployments
---------------
1. Copy a live database (probably the easiest) or run any outstanding migrations off of a skeleton database.
2. Set permissions in pg_hba for the database, host, and user to match your configuration
Manually from within the /ninjawars/ folder of your working copy
-----------------------
1. ln -s docs/harkSAMPLEhtaccess deploy/www/.htaccess
3. ln -s docs/tchalvakSAMPLEresources.php deploy/resources.php
4. mkdir -p deploy/resources/logs
6. mkdir deploy/templates/compiled
7. chmod 777 deploy/templates/compiled
5. configure a virtualhost in apache (should be optional, this may be able to be handled by the .htaccess, I'm not sure)
所以最重要的是 chmodding、复制数据库和编辑虚拟主机。
在 Linux 上尽可能地简化太棒了,更重要的是在 Windows 上也能简化它(我的许多用户目前居住的那片陌生的土地)。建议?
I have a php application ( http://github.com/tchalvak/ninjawars ), essentially a php-based webgame that I run at http://ninjawars.net . I frequently configure and install the app for myself for localhost development, and it's a somewhat trial-and-error hacked-up process. Now that I've open sourced the app, I've got some users wishing to install it and make edits, submit patches, etc, and I want to make that as simple as I can for them.
I've heard of Ruby Gems, which I take to be a kind of package management system for ruby apps. Is there anything useful like that for php? Otherwise, what should I do to make installing as simple as I can?
Right now I think that a general idea of the install process may be as simple as:
All Deployments
---------------
1. Copy a live database (probably the easiest) or run any outstanding migrations off of a skeleton database.
2. Set permissions in pg_hba for the database, host, and user to match your configuration
Manually from within the /ninjawars/ folder of your working copy
-----------------------
1. ln -s docs/harkSAMPLEhtaccess deploy/www/.htaccess
3. ln -s docs/tchalvakSAMPLEresources.php deploy/resources.php
4. mkdir -p deploy/resources/logs
6. mkdir deploy/templates/compiled
7. chmod 777 deploy/templates/compiled
5. configure a virtualhost in apache (should be optional, this may be able to be handled by the .htaccess, I'm not sure)
So the biggies are chmodding, copying the database, and editing a virtualhost.
Simplifying that as much as I can on linux would be great, even more so simplifying it on windows as well (that unfamiliar land where many of my users currently reside). Suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于linux,创建一个install.sh脚本文件并告诉人们
chmod +x ./install.sh
然后执行或双击它。该文件将提示输入 mysql 用户名和密码,与 mysql -u root -p -D db_name一起使用。 ./db_install.sql
然后将安装模板 cp(复制)到 /var/www/ 或他们在提示符下输入的路径。抱歉,不知道 Windows 的情况。
For linux make an install.sh script file and tell people to
chmod +x ./install.sh
it then execute or double click it. That file would be some prompts for mysql username and password to use withmysql -u root -p -D db_name < ./db_install.sql
then cp (copy) the install template into /var/www/ or the path they type in at a prompt.No idea for windows sorry.
PHP PHAR 可能有用: http://www.php.net/manual/ en/intro.phar.php
PHP PHAR might be useful: http://www.php.net/manual/en/intro.phar.php
对于 Linux,您可以创建 rpm 或类似的
for linux, you can create a rpm or similar
对于用户来说,最好的方法是编写自己的安装例程,并将其与应用程序捆绑在一起,类似于 Drupal、Joomla 等。
最快的方法可能是为 linux/osx 编写一个安装 shell 脚本,并为 linux/osx 编写一个批处理脚本。视窗。
The best way for your users would be to write an installation routine of your own and bundle it with the application similarly to Drupal, Joomla, etc.
The quickest way would probably to write an installation shell script for linux/osx and a batch script for windows.