PHP is the most popular language for Web development. A common question is "Why PHP?". This page is an update for 2018.
Back at the start of PHP, the first version handled forms better than anything else on the Web. PHP version 3 handled everything you needed for the Web, was really easy to use, and the only argument against PHP was the processing speed for some code.
PHP 4 was faster than PHP 3. PHP 5 was faster than PHP 4. PHP 7 is faster than PHP 5, uses far less memory, and is close to machine speed, the maximum speed you can get from a computer.
Lets focus on execution speed for a few seconds. Machine speed is the maximum speed you can get from a computer. You have to write your programs using assembler, a very slow and tedious process. You then have to use a different assembler language for every type of processor.
The C programming language is a poor substitute for assembler but C code can be compiled on most computers. PHP 7 runs at a speed close to C. The small difference between PHP and C is less than the hardware performance improvement you get every six months.
Which brings us to development speed.
Most Web development uses frameworks or a similar set of reusable code. You create code using building blocks and code specific to your application or business. Frameworks and libraries of code can be slow to execute. What they do is save development time.
If you start from no code, your Web site might require two years of development in PHP or ten years of development in C. Using libraries of prewritten code might cut the development time in half. A framework might cut development time to a quarter or less, compared to writing the code yourself.
Due to PHP's popularity, there are many PHP frameworks for Web development. C has libraries but no frameworks for Web development. If you started a new project with C, the project could be obsolete long before your code works.
There are many options for fast code or fast development, Rust, Java, and others. They all have serious limitations without offering an advantage over PHP 7 for Web development.
Total cost of ownership (TCO) increases in priority every year. Software used to be a small proportion of the cost. Today hardware is cheaper, developers are paid less per hour and put in less hours to build a working Web site, everything is decreasing in code except software licensing. That means the software cost is rapidly increasing in proportion to everything else.
PHP is free. There is no purchase cost, no renewal cost, and no license management cost. PHP frameworks are free. You can completely bypass frameworks and move straight to a free open source content management system.
Compared to other languages, PHP creates far less disruption when you move to a new version, another big time and cost saving.
Your Web site needs an operating system, a Web server, a database/datastore, and a development language. PHP works on every useful operating system. PHP works with all the popular Web servers. PHP connects to all the useful databases and many that are not so useful. PHP works with all the other forms of data storage.
There are some frameworks that use unusually large amounts of memory. That is due to the framework, not PHP. The only tough choice you have to make with PHP is which framework or CMS.
People are your most valuable resource. You need only one third the number of people with PHP, compared to the best of the alternatives. You will also find PHP experts faster than for other languages. Existing staff can learn PHP, something that is just not practical with other languages.
When you move into framework selection, there can be differences in the availability of experts for the framework part of the development. Overall you are more likely to have the right people for every part of your project.