4

I have my lampp installed in the default /opt/lampp directory and the PHP code is in the htdocs folder. Now, to edit any of the files I have to use sudo permissions and have to type my password (or use sudo -i) which I do not want to do.

All I want is to know if I can somehow make lampp use the code that is residing in a folder not located under /opt/lampp/. I tried giving full path and using a '..' relative path - both did not seem to work.

Or is it okay to do my work in /opt/lampp/ folder by using sudo all the the time?

Marco Ceppi
  • 48,101
Sundeep
  • 253

2 Answers2

1

To actually answer your question although I believe using lampp is not a good thing:

Try to use a symbolic link. Change into your htdocs directory and do something like sudo ln -s /home/<your user name>/Documents/my_website my_website where ~/Documents/my_website is a directory in which you can put all your PHP scripts. Make sure this folder exists. This is now tested and it works for me.

dAnjou
  • 2,035
-3

lampp is the most stupid thing I know. There are dozens of web servers you can install using the package management, for example apache's httpd. All you have to do is install apache2 Install apache2 and php5 Install php5. Then do sudo a2enmod userdir and sudo /etc/init.d/apache2 reload. Now you can put all your PHP scripts in ~/public_html/ and access it on http://localhost/~<your user name>/

dAnjou
  • 2,035
  • But LAMPP (XAMPP) has several package versions. I used to install XAMPP to get php-5.2 since ubuntu has updated to php-5.3 and doesn't provide php-5.2 packages. – Capi Etheriel Jun 26 '11 at 14:32
  • You should ask yourself why you use an almost 5 year old version of PHP which no longer gets any security updates. – dAnjou Jun 26 '11 at 14:50
  • Thanks @dAnjou . Apart from that I have to install MySQL(phpMyAdmin too) and so found LAMPP much easier. I should try out what you have mentioned too. – Sundeep Jun 26 '11 at 17:55