php refers to "hypertext preprocessor" and is an open source scripting language executed on the server side. Laravel is a Web open source framework based on the PHP language and adopts the MVC architectural pattern; it can help users build a perfect network APP, and every line of code can be concise and expressive.
The operating environment of this tutorial: windows7 system, Laravel6&&PHP7.1 version, Dell G3 computer.
What is php
PHP (PHP: Hypertext Preprocessor) is a "hypertext preprocessor", which is a script executed on the server side Language, especially suitable for web development and can be embedded in HTML.
PHP syntax learned the C language, absorbed the characteristics of multiple languages of Java and Perl to develop its own unique syntax, and continued to improve itself based on their strengths, such as Java's object-oriented programming. The language was originally The main goal of its creation is to allow developers to quickly write high-quality web sites.
PHP supports both object-oriented and process-oriented development, and is very flexible in use.
PHP language, as a high-level language, is characterized by open source and belongs to the C language system in terms of design system. It allows many beginners with higher education to quickly accept and complete introductory learning. It is simple and easy to use. It’s easy to get started and find a job, so you’ll have many fans. If the amount of data is large and the access pressure is high, technical solutions such as redis, mysql table partitioning, elasticsearch search engine, message queue write protection, and PHP system distributed cluster deployment can be integrated to alleviate the problems caused by data storage, service access, and data retrieval. huge pressure.
Whether it is a large, medium or small project, PHP is a very suitable high-level programming language. Whether it is suitable depends on the mastery of the project R&D team. But for larger and more complex projects, the most common php-fpm programming model shows its weaknesses.
In view of the series of shortcomings exposed by PHP-fpm, the simplest and most reliable solution is to promptly upgrade to a higher version compatible with PHP. Compared with PHP5.6, the performance of PHP7.0.0 has been improved by 2 times. In addition, PHP7.4 The provided Preloading mechanism realizes the resident memory of some programs and achieves good performance improvement. In PHP8, it also provides efficient JIT (Just-In-Time compilation) operation support.
In addition, developers with higher level can turn to the more difficult php-cli programming, which can solve most system performance problems. Both PHP7 and PHP8 support this mode of programming.
What is laravel
Laravel is a simple and elegant PHP Web development framework (PHP Web Framework). It can free you from messy codes like noodles; it can help you build a perfect network APP, and every line of code can be concise and expressive.
Laravel already has an advanced PHP ActiveRecord implementation -- Eloquent ORM. It can easily apply "constraints" to both sides of the relationship, so that you have complete control over the data and enjoy all the conveniences of ActiveRecord. Eloquent natively supports all methods of the query builder (query-builder) in Fluent.
Because Laravel has excellent features such as Rails agile development, deeply integrates PHP's powerful extension package (Composer) ecosystem and has a large audience of PHP developers, Laravel has gained tremendous popularity in just a few years after its release. Rapid development. We can see from the trend chart (Figure 1.1) provided by Google Trends that in the past seven years, the growth rate of the Laravel framework has been the fastest in history among various PHP frameworks. This also directly reflects Laravel's growth rate in a positive way. strong, and its future development prospects are very impressive.
Why is Laravel so popular?
When an excellent engineer builds a language framework, he should know how to coordinate the relationship between the framework and the language, and use the wisdom of predecessors to think about the rationality and scalability of the framework. . Laravel author Taylor Otwell certainly does this.
Senior web developers should have heard of a well-known web development framework called Ruby on Rails (Rails for short). Rails is a Web development framework based on the Ruby language. The framework has the following principles:
Emphasizes and focuses on agile development;
High contract Convention over configuration;
DRY (Don't repeat yourself) Don't repeat yourself, advocate code reuse;
Pay attention to " Encoding pleasure”.
Since its birth, Rails has received widespread attention and discussion from the technology community. Laravel is highly respected in the PHP community because it combines these excellent features of the Rails framework.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of what are php and laravel. For more information, please follow other related articles on the PHP Chinese website!