Home > Uncategorized > Hot damn, I gots me some PhP!

Hot damn, I gots me some PhP!

December 30, 2008

I’ve been trying to puzzle out how to set up Apache/PhP on my Linux machine, and I just got it working.  It was SO much easier to set up on a Windows machine, which reveals an important truth:

“User-friendly” means whatever you are familiar with.

I’m new to Linux, and so far I like it.  But it is a different neighborhood.  The main stumbling block has been figuring out Linux folder permissions and how to assign them.  The forums all say something like “Just use chmod ug -R +rw /var/www” as if that would make any sense to someone who’s been running windows systems for 15 years.  I got the permissions changed but clearly Linux permissions are a whole new dimension I must grok.

Feeling like an idiot is good for me as a computer support professional; it helps me build empathy with my customers.  But is is stressful.

Now I can start really screwing around with PhP.  I ran it years ago on a Windows/IIS server so hopefully a few of the old brain cells devoted to that memory will kick in as I study.  I’ve been presented with the need to understand it better and this break between semesters is an opportunity to do that.

Categories: Uncategorized
  1. December 30, 2008 at 19:39 | #1

    Cool!  once you get it down, I’ll have a resource.  ;)

  2. December 30, 2008 at 20:59 | #2

    once you’ve gotten down “chmod 744” and understand the “sticky bit”, you still left to wonder if you can read a file such as

    ——r—r—1 juser juser 23911 2008-01-11 13:42 xx

    if you are both juser and in the group of juser

    and then you start to wonder if root can create a file that it can’t delete (google “immutable”)

    and then you will run into the differences in directory permissions between BSD and linux.

  3. December 30, 2008 at 22:40 | #3

    Well, WD, I’d advise against holding your breath, because I never was a quick study.  But I sense a more knowledgeable disturbance in the Force nearby…  :coolsmirk:

  4. December 31, 2008 at 01:15 | #4

    For web based work I recommend creating a web user. Give that user full access to your web directory and sudo access so you can sudo that account. And give this account access to nothing else. Then any files you create in your web directory, do so with the web user. This way you have a little more security and accountability.

    Also, for permissions, “chmod” and “chown” are going to be your friends. For files and folders in your web directory, “chmod 755 [file or folder]” will be your friend. Using numbers with chmod is done in binary. 1’s bit, 2’s bit and 4’s bit. All turned on gives you full permissions. Read + write + execute means 4+2+1 or 7. Read + execute means 4+1 or 5. And so on…

    For chown, “chown [user:group] [file or folder]”. It will give ownership to the user and group specified. This command may be a lifesaver when you accidentally create a PHP file under root or some other account and then cannot access it via your browser.

    Are you going to get into MySQL at all? You can really do some cool stuff with PHP and MySQL…

  5. J. J. Ramsey
    January 11, 2009 at 13:34 | #5

    IIRC, Windows XP has file and directory permissions as well, and some of that knowledge should translate over to Unix and Linux. Heck, you may even be able to use the GNOME file manager to handle permissions in the future. About the only thing that might be weird about Unix-style permissions is that the permission for entering a directory is set by the “execute” bit.

Comments are closed.