How to install XAMPP on other drive then `/opt/`

11,674

Solution 1

This is exactly what do you want:

open terminal using ctrl +alt +T

Change the root permission for that folder permanently :

sudo chown -R $LOGNAME /opt/lampp

Now you don't have to give permissions repeatedly for lampp directory. Move the xampp folder to your desired directory then create a symbolic link to that folder

sudo mv /opt/lampp yourDirectory
sudo ln -s yourDirectory /opt/lampp

Its all done.

But This doesn't seem anything natural to me. You can use the following instruction if you want to keep stick with Xampp. My suggesion is using bitnami lampp you can choose here location of your installation. so in this way you can install lamp in anywhere and doesn't need permissions everytime. https://bitnami.com/stack/lamp

To make bitnami lamp behave like Xampp do the following changes:
Track every changes instantly:

To disable PageSpeed, uncomment by removing '#' the following lines in your httpd.conf (installdir/apache2/conf/httpd.conf)

   #Include conf/pagespeed.conf
   #Include conf/pagespeed_libraries.conf

To disable OPCache, change opcache.enable in your php.ini file and set it to 0 (installdir/php/etc/php.ini

Do some other changes (such as showing error in php):

open installdir/php/etc/php.ini and change all values to devolopment values to do this read the comments in that file.

Default phpmyadmin username for bitnami lamp: root

Solution 2

which is I guess Ubuntu's OS drive folder.

No, it is defined by the Filesystem Hierarchy Standard. See: How to understand the Ubuntu file system layout? All installations that are foreign to the operating system should default their installation path to /opt.

How can I install XAMPP in another Linux path other than the default /opt/ ...?

You must install Xampp in /opt/lampp since this is hard coded in some binary files but nothing is stopping you from symlinking it though. Example:

ln -s /some/random/directory/lampp /opt/lampp
Share:
11,674

Related videos on Youtube

Bsienn
Author by

Bsienn

Updated on September 18, 2022

Comments

  • Bsienn
    Bsienn over 1 year

    How can I install XAMPP in another Linux path other than the default /opt/ which is I guess Ubuntu's OS drive folder.

    In Windows, I have C drive for Windows and a D drive for XAMPP. Therefore if I mess up the OS, my database and htdocs are safe.

    I have searched Google but not able to found how to install the complete XAMPP on another partition.

    I know we can change the htdocs folder and set the path in httdp.conf file, but I also want to save the database folder in my XAMPP based drive.

    Please guide, thanks.

    • Rinzwind
      Rinzwind over 10 years
      This is one of many reasons I would always suggest to use our native LAMPP stack. Is is pre-configured for Ubuntu and comes with sane defaults ( help.ubuntu.com/community/ApacheMySQLPHP )