PHP on linux or windows

6

Explanation:

I know it's a controversial question, but I'm not an old man of the programming and I'm knowledgeable about linux, but I've never chosen it because I use C # from time to time and in my college they are pro-microsoft. So the works mostly is in Windows and I think Dual-boot does not do well for my PC that does not look like it was made for it.

Question:

My programming language is effective PHP and I see frameworks that abuse Linux more than Windows itself, should I surrender and buy a linux notebook or are there senior professionals who like Windows to mess with Linux? / p>     

asked by anonymous 01.05.2015 / 06:03

2 answers

10
  

And what myth is this that only the seniors of programming use linux? Do not believe everything they tell you:)

PHP is a multi-platform language, ie just have PHP installed for the chosen system version and it will work.

The PHP APIs are all compatible with any operating system (having rare functions that do not work on Solaris (another operating system) and few functions with vague differences between systems, if used in a generally advanced way.

I've never seen this from PHP "abusing Linux", who told you this was probably wrong.

The only thing that will change from Windows to Linux / Unix to PHP:

  

Note that to refer to systems similar to linux or unix we can use the term *nix or the term like-unix (much used by the gringos)

  • Folder Split in Windows uses \ and in * nix uses / , however if you use only / it will work on both systems
  • * nix has folder permissions for writing, reading, and running Windows not
  • The folder architecture (does not influence much, as usually PHP scripts are in a folder only)
  • * nix is case-sensitive, ie if you have a file named Foo.txt and use the is_file('foo.txt') function, it will return false , however in Windows it is case-insensitive, ie it will return true , so you should only be careful on windows, as this can cause problems if the production server is * nix.

So the choice of environment makes little difference to PHP and the rare incompatibilities are usually resolved with other API functions.

Summarizing:

You do not need to buy a computer with Linux just understand the differences of both types of systems (mainly architecture of folders)

Install PHP

Extras

  • PHP can run as a server, however it is not a full server and is only recommended for the development environment, it only works as a server stand-alone , to work as a" full "server you need to download the software separately such as mysql and apache, but there are easier ways, as written above.

  • The Wamp meaning would be Windows Apache, Mysql and PHP, as well as Xampp means Apache, Mysql, Php and Perl (the X indicates multi-platform) and Lamp would be Linux, Apache, mysql and PHP. >

  • In addition to Apache, there are other alternative servers like Nginx and Lighttpd

  • Linux is not an operating system, it is the core or a Linux system is actually a Linux-based system only, I believe all Linux distros today run with linux-3.* or linux-4 .

  • Unix is also not a system, but a core, which is used by many systems (modified of course), such as MacOSX and the BSD family.

  • Linux and Unix even though they use a similar folder structure and have similar "high-level" responses, they are not an evolution of the other, nor are "cousins" formal Linux would be GNU / Linux) would mean something like G NU is N ot U nix It's not Unix)

  • The equivalent of them in Windows would be the NT core.

    Read more at: Kernel_ (operating_system) en

  • C# can run in Linux environments using Mono , in addition to C # there are other languages supported and incredible that it seems some of the projects that support these languages can support "Windows" as well.

    Supported languages ( languages in Mono ) :

    • C #, F #, Java, Scala, Doo, Nemerle, VisualBasic.NET, Python (there are two PythonNet and IronPython options), JavaScript (IronJS), Oberon, PHP, Pascal Object, Moon, Cobra

    Other languages:

    • Component Pascal, Delta Forth, DotLisp, #Smalltalk

    Supported but not maintained languages:

    • C, Ruby and Ada
01.05.2015 / 06:20
4

I'll address the topics in parts:

Windows vs. UNIX for application development

There are basically two types of operating systems in mass usage in the world today: Windows w UNIX (Linux distributions, Apple OS X, BSD). SO's of these two types are extremely different, solve problems in completely different ways and have very conflicting usage philosophies.

I will not go into detail about these differences here because I think it does not fit into this topic, but it is very useful to keep in mind that there is no way to compare the two directly and choose a better one: they are different animals, each with its qualities and defects ; pointing out that one is better than the other without taking into account the context where they are being used would be stupid.

Server operating system

The overwhelming majority of web servers run Linux, as this is the most ubiquitous and most widely supported operating system for running web applications and being completely free and free. Obviously there are many applications running in Windows environments, especially those using Microsoft technologies, such as the .NET platform (C #, ASP.NET, VB.NET) that was specially made to run on that system. In general, the Windows environment may be a bit inhospitable for some types of platforms - try running a Ruby application on Windows without ripping out some hair tufts trying to debug the torrent of problems that occur:)

Operating system for development machine

If you develop applications using Microsoft technologies (.NET for example) there is not much choice: the solution is to use Windows. While there are some efforts by Microsoft to bring its platform to other operating systems (such as Visual Studio Code , released this week by Microsoft), only Windows offers all the support you need to develop such applications.

If you develop applications for iOS or OS X it is even worse: you are required to use a Mac.

Now, for development in other more open technologies there are more options. PHP is a good example: you can develop web applications using PHP on both Windows and UNIX systems. Which one you will choose depends a lot on personal preference. If you prefer command-line tools, you will usually opt for UNIX, since the command-line environment and the tools available on that system are much than those in Windows (a great example is packages: installing libraries and dependencies on UNIX systems is extremely easy using tools such as Homebrew, APT or Pacman, and in Windows this can become an arduous task, since the tools available are not so advanced and use a very different philosophy). If you prefer to use IDE's and other visual tools there is greater flexibility, and using Windows does not become so problematic.

There is also a great influence of the community. A good example is Ruby: the overwhelming majority of Ruby developers - let alone all - use UNIX (Linux or OS X) environments. This is due to a number of factors: although it is possible to run Ruby applications in Windows, it is extremely problematic; most Ruby tools use the command line and are inspired by the philosophies of the UNIX environment. Soon it is almost obvious to use Linux or OS X to develop this kind of application.

Just by way of illustration: most of the developers I know use UNIX - some Linux distribution or OS X - but this is a reality of the type of application I develop and the community in which I am included.

Dual-boot

You can do dual-boot on any computer, you do not need a specific computer to run Linux. Modern distributions have great support for various types of hardware, and we each have more advancements in this area, so you should have no problem running a Linux distribution on current hardware.

    
01.05.2015 / 07:25