Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
1  
Please refer to Permissions issue: how can Apache access files in my Home directory? for reasons why you are having issues with home directory paths for Apache. As I believe this is a duplicate of that question. –  Marco Ceppi Jun 26 '11 at 15:07
    
@Marco Ceppi Thanks for adding the lampp tag. I tried to, but, new users are not allowed to create new tags. My search wasn't effective enough to find that question. Anyways, I have to find out about execute bit and then try the mentioned solution. I will do it and update. –  Sundeep Jun 26 '11 at 17:52
add comment

2 Answers

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.

share|improve this answer
    
Thanks for that. I will check this out too. –  Sundeep Jun 26 '11 at 17:55
    
Why has this been downvoted? –  Capt.Nemo Oct 16 '11 at 0:32
add comment

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>/

share|improve this answer
    
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. –  barraponto 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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.