Six reasons PHP is incompetent on a large system (shooting bricks)
After the issuance of this article, it really caused a lot of controversy. It seems that there are many supporters of PHP. But looking at Php from one side is a must.
From PhP3 to PhP4 to PHP5, to php6,php, it is more and more perfect, and the function is more powerful. PHP is an open source project that includes a descriptive language engine that simplifies the program, a large library of links, and a company that specializes in PHP, such as Zend, which sells PHP packaged products, program authoring tools, and technical support services. In particular, cross-platform usage features will make it shine on the Linux platform. You can directly use Java's class library, and you can directly invoke programs written in languages such as PERL/C to enhance its extensibility. An increasingly mature MVC development framework enables it to adapt to large-scale application development at the enterprise level. Plus it's inherently powerful database support capabilities. Indeed won the applause of many users!
However, there are several reasons why PHP might not be competent to look at the side.
1. The scope of application is still limited
PHP is more restrictive than Java, and it can only be used on Web servers, unlike Java, and can be used on Web servers, personal computers, mobile phones, chip cards, or other devices. Remember an old friend who gave up PHP because: "First: Each variable is preceded by a $ sign;?? Second: Because it is not the way to compile execution; Third: The object-oriented function is not strong. "For example, the OOP of PHP runs out once, the next time to continue to rebuild O, continue to inherit .... Note that every request, it cannot take advantage of the last result, and the next time it is initialized from scratch. The root of many problems is Apache.
One more: "Maybe php now??" The IDE is not very good, it is difficult for others to get started feeling. "Although the new version adds object-oriented functionality, there are still a lot of improvements to be made compared to mature java. So that some people are so summed up: (1) Lack of widespread use, so that Microsoft will also discuss with you PHP to the migration of ASP. (2) The lack of support from large companies, like IBM's Development Center open source project on the first page of the 6 headings, PHP only 3. (3) Lack of heavyweight applications, like Google and Yahoo in PHP (not all products) are blind play. Of course, I know that taobao.com is also made by PHP.
2. Debugging is not very convenient
The process working mode on Apache. Apache Processing every PHP request, to create a sub-process, so that the connection pool is difficult to implement, the data sharing between processes can only be through the file, the database what the completion, the cost is relatively large, of course, the speed is not low.
Or to state a Netizen's speech: "There is no good development tools, debugging is too complex." Although Zend is good, but where is the opponent of vs. No strong visual development tools, in other words, if there is, I absolutely choose PHP. "It seems to be a similar scenario in the early days of Java." Perhaps, in the near future, we will see good debugging tools. The problem is: it's not very satisfying, especially on large systems.
Another problem is that the use of shared memory, I do not know why the direct use of PHP operation shared memory is so complex, and the speed is actually more than the direct operation of the disk file is slower.
3. The mainstream version of the security loopholes
See a recent news, and the Php pdflib extension bypasses the Open_basedir security Restriction vulnerability. Affected system: Php PHP 5.3.0. the pdflib extension used by PHP does not properly enforce the underlying PHP configuration directives, which allows an attacker to bypass the open_basedir limit to write files in a non-authoritative location. This vulnerability occurs only in shared managed configurations where multiple users can create and execute arbitrary PHP script code. In this case, the open_basedir restriction should isolate the user from each other.
PHP V6 also removed some of the functions and features from previous versions while adding some new features. Most of the things that are removed, such as register_globals and safe_mode , are widely considered "vulnerable" in current PHP because they can incur security risks. Of course, the configuration of PHP is very flexible, can be set through PHP.ini, httpd.conf,. htaccess files (which must be set allowoverride all or options), and can be used in the script Ini_set () and other specific functions to set. The Phpinfo () and Get_cfg_var () functions allow you to get the individual values of the configuration options.
4. Stability of large-scale systems and the style of a language
Some people say (also a PHP reader's question): "Large-scale system or with. NET or JSP, not because PHP is unreliable, because the development of PHP people are mixed, and PHP development model is not fixed, in the case of you ask this question, if it is a multi-person development, you certainly control not good." NET or JSP is relatively easy to control, can make the program structure clear, two times to develop or replace programmers are not too much trouble. ”
Bruce Eckel, a veteran computer writer, also said: "You often find many code errors written in PHP, but the code is often copied from one another, but no one is seriously analyzing them." The code is usually written by programmers who are used to learning from each other's copy code, and the poor quality of the code is that these programmers are often not used to asking why, they don't like figuring out the principles, they just use them. "In order to be credible, let me release his picture."
?
Naturally, as a general reader, there is a focus question: Is there a future for PHP? You say there is a future, what are some reasons?
5.PHP Explanation of operating mechanism
Perhaps the most painful part of an experienced PHP programmer is the PHP explanation run mechanism. This mechanism allows each PHP page to be interpreted and all related resources will be recycled. In other words, PHP has no way of keeping an object resident in memory at the language level. In PHP, all variables are page-level, whether global variables or static members of a class, are emptied after the page has finished executing. In JSP, for example, in JSP, the Java bean scope has four valid values: page, application, session, request, respectively, corresponding pages, programs, sessions, requests four lifetimes. In PHP, however, only the page has a lifetime.
In PHP, if you need to share data between pages, you need to manually save the variables to the predefined global variables $globals or $_session. PHP saves these variables in a file so that they can be read the next time the page executes. However, there are great limitations in this approach, and it is not possible to save variables that reference external resources, such as files, sockets, database connections, and so on, which are most needed to be cached, in addition to inefficiency.
This has led to the inability of many advanced models and technologies to be used. For example, even the simplest singleton mode cannot be applied in PHP. Although PHP can be used to write singleton code, but because there is no real global static variables in PHP, so every time the page is executed, the new object will be re-established, so that it completely lost the meaning of Singleton. This also leads to complex or mapping techniques that are difficult to apply because there is no caching mechanism for objects, or the overhead of mapping has made this technology meaningless.
6. How long will the open source business model last for an uncertain future?
The importance of MySQL is obvious to the comrades in PHP development. Or a veteran computer writer Bruce Eckel: PHP is primarily used with databases to handle all consistency issues, so most people only care about accessing data from the database, instead of having to consider the underlying problem. But this language can not only deal with the upper layer of the database interaction, but also can implement the underlying problem of interacting with the file system. My feeling is that most people in the PHP community only care about how to get a good result, and no one cares about how it really works, so there's a tendency to make this mistake.
Another News (2008-1-21): Foreign media today published an analysis of the article said that Sun spent $1 billion to buy open source software company MySQL, mainly to enter the Web2.0 software market. Sun announced in Wednesday that it had reached a final agreement with MySQL to buy the open source software vendor for $1 billion. In terms of trading value, this is by far the largest transaction in the Open source field, its size even close to the sum of all open source transactions, Including Red Hat's $326 million takeover of Jboss,citrix for $500 million to buy XenSource, and Yahoo buys Zimbra for $350 million.
In the article Sun CEO Blog: Why we acquired MySQL, Sun's president proposed that, in addition to acquiring Mysql,sun, a global support solution for the MySQL market would be presented. We will also inject money into both the community and the market – to accelerate the process of transforming the industry from proprietary technology to open network platforms. The CTO of the company and the network company did not agree to the use of non-open-source products that were charged. They need and want to acquire source code for optimization and quick resolution (although they are happy to pay for support services that they deem valuable). On the other hand, more traditional CIOs do not agree to the use of products that are not backed by the background of business relationships – because they are more comfortable with Sun's suppliers to manage their global business and critical infrastructure.
Analyze it carefully. or the old saying, you might think PHP is free, and all the PHP modules mentioned in the manual are free. However, like a life-like product, free things, there may be many ideas of disunity.
?
< type= "Text/javascript" >< type= "Text/javascript" src= "Http://pagead2.googlesyndication.com/pagead/show_ Ads.js ">
?
One night, commenting countless. The opposing opinion is not unacceptable, but here is an old friend's rebuttal:
?1.?? An object-oriented problem??
? If you've used PHP 5, you won't say what you think: access rights (public/private), inheritance, abstract classes, interfaces, clones, serialization, automatic garbage collection, static members, powerful exception handling ...??
? It can be said that basically common object-oriented things have, do not think PHP5 is very remote, in fact, there are many people, many projects are using PHP 5, you'd better try to see for yourself.
? Recommended reference:??
? http://www-128.ibm.com/developerworks/cn/opensource/os-phpobj/??
? http://www-128.ibm.com/developerworks/cn/opensource/os-advphpobj/??
? 2.?? Variable name in front of the add?? $???
? This can only be considered a small problem, PHP is to tell everyone this is a unique feature of PHP, PHP is not Java, not C + +, it is from the open-source world out of the scripting language, with $, I feel very cordial, very good.
? 3.?? Not compiled to execute??
? This is certainly not as good as CGI, if you write CGI with C, but I think, php execution speed is not worse than the JSP, it is not slower than ASP. In addition, Zend has relevant business tools to do similar to the work of compiling.
? 4.?? PHP is too flexible??
? I think, people prefer to be able to control the language, so as to embody the programmer's technology, of course, flexibility will also bring a lot of problems, such as easy to make mistakes, and not easy to find, for beginners of the code may write very bad. However, this is PHP ah, this is our idea of open source, free, efficient PHP?
? 5.?? No MVC framework??
? Oh, if you have used?? Phpcake, Zend?? Frame words, I think you will not say no frame, just the maturity level of the problem, in fact cake and Zend?? Frame is very good, of course, some other elephant?? Prado, PHPMVC and other frameworks are also worth mentioning??
? Reference: http://framework.zend.com/, http://cakephp.org/??
? 6.?? Not a good IDE??
? PHP is characterized by simple, easy to develop, you can use Notepad, VI, you can also use EditPlus, UE, also can use Nu, Zend and so on tools, choose very big, actually do not compare with VS2003, because they are not a thing, VS is a unified development platform, PHP is just a scripting language, and using Zend is enough, at least I think so.??
? 7.?? Extension not easy to write??
? Oh, I think ASP com is not so good to write, JSP inside the JavaBeans is not so simple, there is no easy thing, simple or complex degree depends on your understanding of a business level. If you learn C well, you will not feel that the expansion is not good to write. Of course, relatively speaking, the C PHP extension is a little bit more complicated, but because of the complexity, so you can rely on writing extensions to get a high salary ah, hehe.
? Suggested reference: "PHP Program Design" 14th Chapter [extension PHP]??
? 8.?? Debugging inconvenient??
? I don't know how debugging is convenient, if you have used Ruby, Perl to write CGI, you will know what debugging is inconvenient. If you like writing C, using a command-line tool like GDB, you'll know what's inconvenient. Of course, relatively speaking, you use a good IDE, debugging work will reduce a lot of.