Jump to content

Running PHP from a USB drive.


pthurmond

Recommended Posts

I am looking into developing an Inventory System that allows the user to run a powerful, customizable sqlite based db from a USB drive. The reason is, I have a client whos company is unable to get internet access in his building and he wants to be able to also access his inventory on his laptop while he is wondering around buying things at auctions out in the boondocks. He wants me to develop an inventory system that is flexible and can be upgraded and changed as needed.

 

I know, your first thought is use MS Access or OpenOffice.org's Base. Problem, he doesn't like the idea of paying for a Microsoft Office license for every computer he uses his inventory on (not that I blame him). The next problem is neither Access nor Base have the flexibility I am looking for (and figuring out forms in Base is a beast). So I want to stick with what I know best, PHP and SQL.

 

My question is this: Has anyone here ever tried running a PHP install from a removable device? What about a webserver? Does anyone have any suggestions as to how to create a file or script that when the user double-clicks on it both PHP and the webservice will be activated (with restrictions for local access only) and then open the default browser to the php app on the USB drive?

 

Has anyone here tried or seen any implementations like this before?

I have heard of using PHP for desktop development, how does this differ from web development (especially pertaining to database interaction and forms)?

 

Thanks for your time,

Patrick

Link to comment
Share on other sites

Not that i'm best person to ask (and the one i'd ask will surely be in bed by now), however you coud mount your drive and then start you the services (mysql & apache), but using links to the mounted partition.

 

I've never tried it so I can't say, however I do have apache and mysql on my laptop. What you could do is write a synchronisation script (either a web page or actual script) which updates the database as required and also any interface pages. Then one updated you can remove usb storage and save the planet like a super hero, oh and your laptop battery life!

Link to comment
Share on other sites

I don't see that running apache/php from a removable device would be any different to a fixed HD.

 

I have heard of using PHP for desktop development, how does this differ from web development (especially pertaining to database interaction and forms)?

 

I assume your talking about using php-gtk. Its really just another set of objects that create desktop windows and widgets. Takes a bit of learning, but its not too difficult. I've always found php's gtk implimentation a little flacky though and would prefer to use something like Python if I had the choice.

 

Another thing you might want to look at is Roadsend. It basically allows you to make binaries of your application, so there is no need for an interpretor.

Link to comment
Share on other sites

I have successfully run XAMPP from a USB key (Apache, PHP, MySQL, etc.). But, be forewarned that flash memory has a finite lifespan of read/writes. Some statistics have it rated as low as 100,000 (some as high as 1,000,000). That might seem like a lot, but a web based solution that utilizes a database can have many read/writes on each page hit. If you decide to go this route you may want to utilize a tool to minotor read/write activity to find out how many times the disc is accessed per page to get a rough idea of the expected lifespan.

Link to comment
Share on other sites

I have also used mysql, php, apache combinations on a usb drive. Installing the whole shebang has usually required at least a 1gb stick. The biggest problem I had was that different windows computers will map the stick to different drive letters, E:, F: etc. I found that easyphp was a good solution to this as it changes to the current drive letter when you start it up. Otherwise it can be a pain to go into the config files and change paths depending on the drive letter. It is based on wamp which I have also found very useful when working on windows computers.

Link to comment
Share on other sites

You can just go into Disk Management and change to the unused letter of your choice.

 

I have also used mysql, php, apache combinations on a usb drive. Installing the whole shebang has usually required at least a 1gb stick. The biggest problem I had was that different windows computers will map the stick to different drive letters, E:, F: etc. I found that easyphp was a good solution to this as it changes to the current drive letter when you start it up. Otherwise it can be a pain to go into the config files and change paths depending on the drive letter. It is based on wamp which I have also found very useful when working on windows computers.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.