Page 1 of 1

USB Tips and Tricks (xampp using relative path)

PostPosted: 08. September 2006 05:33
by patrick_yi_82
If you want to install xampp on an USB using a different folder than the root, try adding the following line to install.php in \xampp\install folder

First look for this line
Code: Select all
$partwampp = substr(realpath(__FILE__), 0, strrpos(dirname(realpath(__FILE__)), '\\'));


Then add this line right after that line
Code: Select all
$partwampp = substr($partwampp, 2);


it'll remove the drive letter and the colon from the path.

M:\PROGRAMS\XAMPP -> \PROGRAMS\XAMPP

now run setup_xampp.bat


I AM NOT RESPONSIBLE FOR ANY DAMAGE TRYING THIS TRICK.


but it works for me :P

USB Tips and Tricks

PostPosted: 08. September 2006 06:08
by Izzy
I can't test that as I don't have a USB stick but it looks as though it might come in handy for those who rely on or use a USB stick.

What advantage does this have over just using the default root directory?

Don't forget to back up the install.php just in case things don't turn out as you expected then it is a small matter to revert.

Thanks for that useful tip. :)

Perhaps it will be the start of a very useful Tips and Tricks thread for Xampp for Windows or you might like to change the Subject heading to USB Tips and Tricks or something similar so it may get some interest - but it's only a suggestion. ;)

PostPosted: 11. September 2006 20:32
by patrick_yi_82
Since sticking an USB into different computers have different drive names, the path name has to be relative.

I have a desktop and a laptop, and I wanted to save all my work on an USB(with a frequent back up on one place), so I can work anywhere I want.


The result is, I have xampp and php eclipse unzipped in my USB, and I can work anywhere I want. :lol:

PostPosted: 12. September 2006 00:18
by Izzy
patrick_yi_82 wrote:Since sticking an USB into different computers have different drive names, the path name has to be relative.

I have a desktop and a laptop, and I wanted to save all my work on an USB(with a frequent back up on one place), so I can work anywhere I want.


The result is, I have xampp and php eclipse unzipped in my USB, and I can work anywhere I want. :lol:

That's a very useful tip for USB stick users and makes the USB implementation of XAMPP truly portable. Great post.
You qualify for the new IAA (Izzy Applause Award)

Image

So if other members have a pet USB stick tip or trick that they find useful and that may be of interest, please post them in this thread.
Thanks!

using system variables in apache config files

PostPosted: 26. September 2006 10:30
by fmn4iun
Is it possible to use %USB_DRIVE% (windows system variable) in xampp config files?

Of course to make such a thing work you have to access system varibles
in My Computer >> System Properties >> Advanced >> System Variables.

PostPosted: 01. November 2006 21:52
by MrWilsonUSCG
THANK YOU!!!! You have become my own personal god!!!!!!


You aren't using the Windows .exe installer are you? Would it be possible to get a true step by step. I've been frying my brain over this problem and I'm not thinking it through properly.

PostPosted: 24. May 2007 15:10
by MrQwest
Thanks for this tip!

I've been running XAMPP on my USB drive for a while now, and this has been annoying me.. I run several instances of Textpattern / Wordpress / Vanilla / phpBB on my pen drive which account for most of the sites i maintain running with a (near) current version of the sites i run.

However, i use 3 different computers. My home desktop, my laptop and my work desktop. And on all 3 computers, my pen drive shows up as a different drive letter (home PC: K, laptop: F, work: L).

One question though.. I installed and ran xampp on my pen drive about 3 months ago. Can i go into install.php now and add the new code. Will it cause any problems? Will i have to re-install XAMPP or will it be ok?

PostPosted: 25. May 2007 15:32
by lyntuan
Thanks to AMPstart, XAMPP can work from any pathname without editing configuration files.

Simply put AMPstart in XAMPP folder and run it. That's all.

AMPstart does not use any file in root of XAMPP, hence you can delete them.

http://ampstart.com

PostPosted: 30. May 2007 08:34
by MrQwest
lyntuan!

Thanks for that, sounds exactly like what i need!

Am i correct in thinking that AMPstart replaces xampp_control?

PostPosted: 30. May 2007 14:49
by lyntuan
MrQwest wrote:lyntuan!

Thanks for that, sounds exactly like what i need!

Am i correct in thinking that AMPstart replaces xampp_control?

AMPstart is another XAMPP launcher!

http://ampstart.com

PostPosted: 20. June 2007 16:53
by jackfusion
patrick_yi_82 wrote:Since sticking an USB into different computers have different drive names, the path name has to be relative.

I have a desktop and a laptop, and I wanted to save all my work on an USB(with a frequent back up on one place), so I can work anywhere I want.


The result is, I have xampp and php eclipse unzipped in my USB, and I can work anywhere I want. :lol:


How did you install java 2 for php eclipse on your usb?

PostPosted: 25. November 2008 02:56
by Count Chocula
I found a way of modifying the preferences for xampp in eclipse - works the same and make the root path relative from where eclipse is located so it can be run from a USB stick.

after unzipping eclipse and xampp onto your flash drive, note the installation path for both folders. Open up eclipse, go to PHP perspective, then - window -> Preferences

in the left click in the document tree PHPEclipse -> PHP External Tools.

Click and change the following options for MySQL, Apache and XAMPP by changing the root drive (since it is not known) to "..\..\" (ad nauseam) depending on where the xampp folder is located in conjunction the Eclipse folder (I'm assuming it's also stored on the USB stick). Mine looked like this:

X:\ is my USB drive

Eclipse is here:
X:\programs\eclipse

and Xampp is here:
X:\xampp

Therefore the paths were changed to:

..\..\xampp\apache\bin\apache.exe
..\..\xampp\mysql\bin\mysqld-nt.exe

etc...

Now just change the httpd.conf DocumentRoot to

"/xampp/htdocs" or wherever you want it to point on the stick leaving out the volume letter to make it relative. It's worked pretty well for me so far.