XAMPP在谷歌驱动器 [英] XAMPP on Google Drive

查看:171
本文介绍了XAMPP在谷歌驱动器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近不得不重新安装XAMPP到我的电脑,这意味着不必更换我previously设置的任何配置文件和其他数据文件(如MySQL数据库,网站等)的另一种痛苦。

I've recently had to reinstall XAMPP onto my PC, which means another pain of having to replace any config files I had previously set up and any other data files (such as MySQL databases, websites etc).

我已经做尽可能多的研究这个越好 - 但大多数人似乎只想要同步他们的htdocs和MySQL数据,不过,我想存储的整个XAMPP 的安装在谷歌驱动器,即不再有将其设置在其他计算机等。

I've done as much research into this as possible - but most people only seem to want to sync their htdocs and mysql data, however, I want to store the whole xampp installation on Google Drive, meaning no more having to set it up on other computers etc.

这可能吗?优点/缺点是什么?

Is it possible? Advantages/disadvantages?

如果XAMPP不推荐,将谷歌驱动器上的Apache / MySQL的/ PHP的安装单独足够?

If XAMPP isn't recommend, would a seperate installation of apache/mysql/php on google drive be sufficient?

我如何去这两个思路:


  • 谷歌驱动器上安装的USB便携式版本

  • 安装在PC上的完整版本,然后将其移动到谷歌驱动器和符号链接的位置的驱动器文件夹

我意识到这可能无法与它运行的服务......但除此之外,我不会从每次多台PC访问它,它纯粹是为了有一个服务器准备使用的能力无论我在我的笔记本电脑,PC等..没有更多需要超过网站的配置文件复制或更改两个匹配任何新网站的需求。

I realise it may not be possible to run services with it... but other than that, I won't be accessing it from more than one PC per time, it's purely for the ability to have a server ready to use whether I'm on my laptop, PC etc... No more needing to copy over websites or change config files on both to match the needs of any new sites.

感谢您!

推荐答案

我前一段想通了这一点,不过我只记得张贴答案的情况下,任何人想要它了。

I figured this out myself quite a while ago, but I just remembered to post the answer in case anyone else wants it too.

TL:DR; =虽然这是可能的,这是毫无意义/多开销比需要的。

TL:DR; = While it is possible, it's quite pointless / more overhead than needed.

我最终什么事做会同步是最重要的,这些是区域(XAMPP的根目录下):

What I ended up doing was syncing the areas that were most important, these were (under the xampp root):


  • / htdocs目录

  • / phpMyAdmin的

  • / PHP

  • / MySQL的/数据 - 这里关键是的不可以整个文件夹,只需将数据位

  • /htdocs
  • /phpmyadmin
  • /php
  • /mysql/data - Key thing here is not the whole folder, just the data bit

这确保了PHP和phpMyAdmin的我有跑步的版本都是一样的,那我的数据库是present(耶,没有更多的出口/进口!)。

This ensures the versions of PHP and phpMyAdmin I have running are all the same, and that my databases are present (yay, no more export/imports!).

我之所以不同步阿帕奇文件夹是因为我在我的机器的设置略有不同(不同的路径)。

The reason I do not sync the apache folder is because my setup on my machines is slightly different (different paths).

我用符号链接到文件夹指向他们对Dropbox的位置(是的,我也要求谷歌驱动器,但看到答案的末尾为什么交换)。

I used symlinks to point the folders to their locations on Dropbox (Yes, I did ask for Google Drive, but see end of answer for why the swap).

它的工作原理相当不错,我还没有找到一个更好的解决方案。虽然现在移动的工作流程到虚拟机上的一个转变,我需要这个便携多由于我是多么需要我的笔记本电脑和我的主要PC之间进行切换。

It works quite nicely, and I haven't found a better solution. Although there is a shift of moving workflow onto Virtual Machines now, I need this portability more due to how much I have to switch between my laptop and my main PC.


  • 我遇到了一些小问题,几乎所有与MySQL。

    • MySQL的服务将无法启动总是在机开机,如果它同步文件时,它会尝试加载,而不是一个主要的问题,而是一个微小的细微差别。

    • 损坏的数据库! :-o这是实际上更或多或少从谷歌驱动器移动到Dropbox的,更多关于这个在一端固定

    • 不能可靠地对两台机器在相同的时间,因为它可以导致在数据库中的冲突。当创建一个新的数据库,最好做一台机器上,让它完全启动起来,然后关闭机器并启动另一个所以它需要的东西同步。有时,MySQL服务将必须首先停止。

    我爱谷歌开车,我用它的一切。它的价格便宜,像$ 3的空间或任何100GB相比的DropBox的$ 10(£10?)。

    I love Google Drive, I used it for everything. It's cheap, with like $3 for 100GB of space or whatever in comparison to the $10(£10?) of DropBox.

    一段时间后,因为我的项目增长,我的htdocs成为巨大的,我开始注意的几个问题。我开始使用一种称为Laravel 4一段时间框架,这涉及到很多的文件由作曲家被带入供应商目录。谷歌驱动器似乎它的索引部分,然后只同步某些文件,但是如果没有我实现。

    After a while, as my projects grew and my htdocs became massive, I started noticing several issues. I started using a framework called Laravel 4 for a while, this involved a lot of files being brought into the vendor directory by composer. Google Drive seemed to index part of it and then only sync some of the files, but without me realising.

    这将导致我去我的笔记本电脑一会儿,通常是从我的电脑了,并实现一半的项目被丢失,因此无法使用。在大多数情况下,这些文件不会被拾起,除非我删除整个文件夹或其他一些挂羊头卖狗肉,这是初始项目创建一个相当痛苦。

    This would result in me going to my laptop a while later, usually away from my PC, and realising half my project was missing and thus unusable. The files in most cases wouldn't be picked up unless I deleted the whole folder or some other trickery, which was quite a pain on initial project creation.

    我还发现损坏过于频繁使用谷歌驱动器时的数据库,如谷歌云端硬盘文件夹的文件量增加,坏它得到。

    I also found the database corrupted far too often when using Google Drive, as the amount of files in the Google Drive folder increased, the worse it got.

    最后,我决定换我的<​​code>的htdocs 来的DropBox。有好几个星期没有问题之后,我换了休息了,从那时起我已经与数据库中没有任何问题破坏或任何文件夹无法同步。我想这可能是下降到谷歌驱动器看似无法处理这么多的小文件(作为一个粗略的估计,Laravel 4供应商目录中有4K +文件,想象这像10个项目以及任何其他项目不laravel 4 ...)

    Eventually, I decided to swap my htdocs to DropBox. After having no issues for weeks, I swapped the rest over, ever since then I've had no issues with the database corrupting or any folders not being synced. I think this may be down to Google Drive seemingly not able to handle so many small files (as a rough estimate, Laravel 4 vendor directory has 4k+ files, imagine this on like 10 projects plus any other projects not on laravel 4...).

    虽然仍使用谷歌驱动我找到了一个安全的方式,以确保我的数据库或多或少是即使损坏的安全,我创建了一个批处理文件(是的,Windows用户)做所有非默认数据库的数据库备份(跳绳,基本上都与MySQL / phpMyAdmin的的那些)到.sql文件而不是谷歌驱动器/ DropBox的一个文件夹中。这意味着,如果我的数据库没有损坏,最坏的这种情况是我已经失去了数据库,通常不会达到很多(特别是如果你使用的迁移创建表)在一天的工作。这是丢弃损坏的表/数据库,并通过.sql文件恢复它们的只是一个简单的任务。

    While still using Google Drive I found a safe way to make sure my databases more or less were safe even if corrupted, I created a batch file (Yup, windows user) to do a database backup of all non-default databases (skipping the ones that come with MySQL / PhpMyAdmin basically) to a .sql file in a folder not on Google Drive/DropBox. That means if my database did corrupt, the worst that happens is I've lost a days work on the database, which usually does not amount to much (especially if you use migrations to create tables). It's just a simple task of dropping the corrupted tables/databases and restoring them through the .sql file.

    这篇关于XAMPP在谷歌驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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