USB Tips and Tricks (xampp using relative path)

Problems with the Windows version of XAMPP, questions, comments, and anything related.

USB Tips and Tricks (xampp using relative path)

Postby patrick_yi_82 » 08. September 2006 05:33

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
Last edited by patrick_yi_82 on 11. September 2006 20:33, edited 1 time in total.
patrick_yi_82
 
Posts: 2
Joined: 08. September 2006 05:26

USB Tips and Tricks

Postby Izzy » 08. September 2006 06:08

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. ;)
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby patrick_yi_82 » 11. September 2006 20:32

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:
patrick_yi_82
 
Posts: 2
Joined: 08. September 2006 05:26

Postby Izzy » 12. September 2006 00:18

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!
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

using system variables in apache config files

Postby fmn4iun » 26. September 2006 10:30

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.
fmn4iun
 
Posts: 2
Joined: 25. July 2006 07:10

Postby MrWilsonUSCG » 01. November 2006 21:52

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.
MrWilsonUSCG
 
Posts: 8
Joined: 04. August 2006 22:54

Postby MrQwest » 24. May 2007 15:10

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?
MrQwest
 
Posts: 2
Joined: 24. May 2007 15:05
Location: London, UK

Postby lyntuan » 25. May 2007 15:32

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
Last edited by lyntuan on 26. December 2008 13:10, edited 2 times in total.
lyntuan
 
Posts: 104
Joined: 08. November 2006 00:21

Postby MrQwest » 30. May 2007 08:34

lyntuan!

Thanks for that, sounds exactly like what i need!

Am i correct in thinking that AMPstart replaces xampp_control?
MrQwest
 
Posts: 2
Joined: 24. May 2007 15:05
Location: London, UK

Postby lyntuan » 30. May 2007 14:49

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
Last edited by lyntuan on 26. December 2008 13:11, edited 2 times in total.
lyntuan
 
Posts: 104
Joined: 08. November 2006 00:21

Postby jackfusion » 20. June 2007 16:53

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?
jackfusion
 
Posts: 1
Joined: 20. June 2007 16:50

Postby Count Chocula » 25. November 2008 02:56

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.
Count Chocula
 
Posts: 1
Joined: 25. November 2008 02:38
Location: Germany


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 159 guests