Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I was just wondering if a typical PHP developers needs to be very familiar with Linux. I am studying Linux right now and I believe some of linux knowledge is not required for a PHP developer job (not sure if I am right about that). For example, vi or shell programming.

In sum: what should I learn about Linux if I only want to land a PHP developer job.

share

migration rejected from stackoverflow.com Jan 17 at 11:18

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as primarily opinion-based by gnat, MichaelT, thorsten müller, GlenH7, Kilian Foth Jan 17 at 11:18

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

9  
linux != bash != svn != nano apache/sites available != sudo /etc/init.d/apache reload –  Captain Giraffe Jul 3 '11 at 1:58
1  
Thanks a lot guys...I can't vote you guys cauz I don't have enough reput.... –  Jerry Jul 3 '11 at 2:12
comments disabled on deleted / locked posts

7 Answers

I think you are wrong(my opinion ;)) and you should learn Linux. You will have a lot of tools available which you need if you want PHP/apache to scale. Like for example redis or memcached to cache your data and APC for byte code caching. Those products are not supported on windows. Also the overall performance of Linux is going to be better than windows most of the times.

Also I like(my opinion again ;)) programming a lot more in Linux then in Windows. I think there are a lot more tools available in Linux compared to Windows. I even think you can faster install software on Linux then Windows because when I used to use windows a lot I have never come across a package manager like for example apt-get from Ubuntu. I also don't think you can compare the Bash(Linux terminal) which is a lot more powerful with Window's terminal.

share
add comment

I was programming for a couple of years in PHP before I ever got near a Linux box and I'm still a little shaky on running my own server. I honestly wish I knew more about Linux, but for basic PHP programming, you don't have to know LAMP; there are alternatives such as WAMP.

That being said, having a bit of knowledge in the secondary aspects of a PHP programmer job (such as c-panel, plesk, web server setup & management and dealing with domains assuming you're looking at the web dev route) cannot be ignored and will always make you more valuable.

At the end of the day do you want to be a code monkey with one trick or a valued team member who is much more versatile and flexible in the job market?

That's a personal choice really.

share
add comment

I was in a somewhat similar position to you five years ago when I started to learn how to develop web applications in PHP. For a couple of years I just used a WAMP setup to develop on and then deployed to a Linux server over FTP. That approach worked but I would say that the quality of some of my work and my productivity was certainly lower.

About three years ago, I made a concerted effort to use Linux as my primary operating system. I started with Ubuntu and then moved on to Arch Linux. I now use Linux Mint. For me, the primary benefits were:

  • a deeper understanding of how to set up permissions to secure my web applications
  • more flexible version control through Git
  • faster code editing with vim
  • increased productivity through the use of the GNU toolchain including tools such as find and grep
  • being able to administer the servers I was deploying code against (e.g., setting up the versions of PHP and MySQL that I wanted to use)
  • being able to save time using bulk operations that you simply can't use without a command-line (e.g., resizing 50 pictures in 30 seconds)
  • encouraging me to work with different programming languages which taught me different programming paradigms which lead to cleaner code

Obviously you're not guaranteed these same benefits but this is what my experience with Linux brought me. I would heavily recommend investing time in learning how to effectively use Linux (i.e., not just learning Linux but how to use the platform effectively).

share
1  
you forgot that when you're using for example debian or ubuntu, to install a php library you can simply use apt-get instead of having to search for the needed files and sometimes even compile it –  HTDutchy Jul 3 '11 at 8:16
add comment

Commands I use in terminal for php development:

  1. ls (ls -lh)
  2. sed
  3. cat
  4. gzip
  5. grep
  6. awk
  7. vi, vim, nano
  8. tar
  9. svn
  10. tree
  11. ln / ln -s
  12. restarting/reloading services (apache, mysql, nginx, whatever)
  13. cp (cp -a)
  14. head, tail, less/more

I dont think any other command is necessary (but all others are usefull!).

I developed for about 3 years on Windows Xp, then migrated to linux (ubuntu) 2 years ago: it changed my production life (in better!).

share
add comment

Personally I would recommend learning as many different things as you can. I recommend reading a really interesting article by Carlos Bueno, who works for Facebook, about the Full Stack Programmer.

It's a pretty big read, but the main idea is that to write really good code, you know to understand as much about the system as possible. That doesnt mean just learning as much as you can about PHP, but also Linux, Apache, MySQL and anything else that you use in your site. While you may learn a lot about PHP (or any language you choose to work in), you also need to understand why you write code the way you do, or how to analyse the code to make it better. Otherwise, you will have issues with performance.

From my experience, there are those who stick with one technology, refuse to look at others, and generally their projects suffer for it. Learn as many different things as you can.

share
add comment

You don't need it unless you do. Unless you're leading a very sheltered developer life, sooner or later you'll encounter more and more of *NIX working with PHP. Learning it will make you a better developer regardless of how much you need it in practice.

share
add comment

I would suggest you learn enough Linux commands to be able to do basic troubleshooting when something goes wrong.

This mean:

  • Be able to get a command prompt, either through a desktop, or a ssh-connection.
  • Be able to navigate with cd and ls to locations.
  • Do basic editing. This implies being able to work well with your favorite editor and do simple editing with vi. Just being able to change a line with vi may save your job some day.
  • Be able to inspect logfiles (e.g. with less). This includes searching backwards and forwards for a specific string.
  • Be able to do simple web server maintenance in case of problems.

Note that this is the bare minimum. Linux has a lot of commands that can help you in the command prompt, but those are not essential.

share
    
I'll add grep to that toolset. –  Lie Ryan Jul 3 '11 at 10:51
    
@Lie, less can do the same as grep on the current file. –  user1249 Jul 3 '11 at 11:07
    
Ravn Andersen: very often you need to search for a string/function name/class name/exception name in all files in a directory containing 1000s files recursively, that's where grep comes in handy. –  Lie Ryan Jul 3 '11 at 12:07
    
@Lie, I am not saying grep isn't immensely useful, it is, but that it goes slightly above the bare minimum. –  user1249 Jul 3 '11 at 12:11
add comment

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