LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Saving PHP scripts in htdocs with permission (https://www.linuxquestions.org/questions/linux-newbie-8/saving-php-scripts-in-htdocs-with-permission-898471/)

RiskyShenanigan 08-20-2011 09:41 AM

Saving PHP scripts in htdocs with permission
 
I am trying to save PHP scripts from a textpad in Linux, however when I try to save it to a folder in htdocs, it says I need to permission. The only way I can think of putting it there is with the Terminal, is there an easier way to save directly?

moravia 08-20-2011 10:16 AM

http://catb.org/~esr/faqs/smart-questions.html

Your question lacks specific details, so I can only make educated guesses. The above page is a good read for how to make your questions better.

I'm guessing you're trying to save files in a system directory like /var/www/htdocs as a regular (not root) user. The correct solution to such a problem varies depending on your rights and goals on the system.

If your goal is to regularly edit files in the directory where you don't have permission, you probably want to give yourself permission. My preference is to set the group of the folder to something that makes sense (httpadmin web admin - pick a group name that works for you). Then add yourself to that group and set the permissions to g+rw for that group.

You didn't mention what distribution you're using, and I'm not familiar with Textpad for Linux. Specifics on adding groups and adding users to groups will vary by distribution. There are probably some common command line options that will work on *most* distributions, but I don't want to lead you too far astray without knowing your specifics and goals.
--
DrMoravia

salemeni 08-23-2011 03:35 AM

Quote:

Originally Posted by RiskyShenanigan (Post 4448599)
I am trying to save PHP scripts from a textpad in Linux, however when I try to save it to a folder in htdocs, it says I need to permission. The only way I can think of putting it there is with the Terminal, is there an easier way to save directly?

Because you don't have permission.
Code:

$ sudo gedit /var/www/htdocs/script.php
generics array


All times are GMT -5. The time now is 01:09 AM.