[Listen to the master talk 4] PHP founder RasmusLerdorf interview 2

Source: Internet
Author: User
Tags apc php session drupal
ChrisDiBona: What does PHP name represent? RasmusLerdorf: PHP yes, well. HypertextPreprocessor, the name is stupid, that is, PHP. Zeev and Andi were added in years. They used phpfi and encountered some problems in deep nesting. They were computer-specialized and knew

Chris DiBona: What does the PHP name represent? Rasmus Lerdorf: PHP yes, well. Hypertext Preprocessor, the name is stupid, that is, PHP. Zee v and Andi were added in years. They used php/fi and encountered some problems in deep nesting. They were computer-specialized and knew

Chris DiBona: What does the PHP name represent?

Rasmus Lerdorf: PHP yes, well. Hypertext Preprocessor, the name is stupid, that is, PHP. Zee v and Andi were added in years. They used php/fi and encountered some problems in deep nesting. They were computer-specialized and knew how to write the parser, unlike my implementation through the hack state machine, I think they will be surprised when they see my program.

Chris DiBona: Well, you can work.

Rasmus Lerdorf: They volunteered to do these jobs. At that time, I was a little tired and felt like I was writing a program for half of the Internet. People didn't patch me to fix the program, but...

Leo Laporte: This is my program. Change the bug.

Rasmus Lerdorf: Yes, I changed this Bug and wrote a program for me to do this. I told them it was very easy to implement this. As long as this was done, they said, "Okay, this is the most troublesome. What about the bugs left"

Chris DiBona: fix the bug.

Rasmus Lerdorf: I was really depressed, and I was just hollowing out. At that time, I felt that I was about to die, or I had to hand it over to a larger team.

Leo Laporte: Well, before we continue, I think this is a very interesting topic. This is not uncommon in the open-source community. This kind of thing often happens. People say, "I can't manage this community. I don't want to do it anymore. I'm crazy"Chris, you must have experienced many such cases. This is not a problem for the open-source community.

Chris DiBona: Yes. Actually, I have discussed this issue with Rasmus. Every five months, someone has publicly stirred up such a problem in the community, someone has left the community ". As you know, it is normal that someone enters and leaves.

Leo Laporte: in fact, this happened recently in the Zend Framework community.

Chris DiBona: Yes. Let's talk about it, Rasmus.

Rasmus Lerdorf: Zend Framework is a separate project. To be honest, I am not very clear. You have to ask them, and I am not clear about the reason.

Chris DiBona: in one aspect, in fact, for most communities,Some people leave quietly, even though I don't want to say that.

Leo Laporte: for users, we are sometimes not satisfied with the products we use.

Rasmus Lerdorf: Until php 3, I am actually the only one doing it. When someone sends me a php patch, I will write it again, because this is my product.

Leo Laporte: It seems that you are not good at transferring jobs.

Rasmus Lerdorf: I am not clear about the open-source theory. At that time, there was nothing open-source,I thought about this myself later. Not long ago,I got a job at the University of Toronto to build a conversation access system. I think it may be 97 years. Oh, it's 96 years. Occasionally, I still receive some patches for php, some bugs I have never encountered before, And I have encountered some difficulties, A programmer in Japan sent me some patches, which are cool. Some friends in Japan helped me with the consulting work,But this is not regular. A year later, I figured it out. I do need to encourage this contribution. People submit the patch and I cannot take over it and rewrite it myself. I should accept it and give up control. Give others the power to do what they want.For most open-source developers, this is very difficult, even now,Open-source projects are their children. They should control them, but for long-term development, you should let them go and let other contributors do what they want to do. You cannot impose too many restrictions.

Leo Laporte: It seems that we should be more radical as users.

Rasmus Lerdorf: It doesn't matter. You should be aware of this. Most of these are open-source developers at home,90% of open-source developers do not care what they do. They put their children to bed,Contributed two hours to open-source projects, and then they opened their emails,I found a lot of angry information, all of which are "there are bugs here, and there are bugs here. This Bug makes it impossible for us to perform millions of e-commerce operations", but they can only say, "okay, I have contributed two hours in the evening. This is really not something I should care too much about (your millions of E-commerce programs )". Therefore, developers of these open-source projects should be given some respect.

Leo Laporte: Open Source is so prosperous. I would like to say that you talents are the source power of the open source community,What we can do is to give you the respect you deserve.

Chris DiBona: Well, I found Rasmus's car a little dirty.

Leo Laporte: Well, I 'd like to scrubbed his car for him. I owe him too much,I ran such a php program on the server, from the log tracking program to drupal.

Rasmus Lerdorf: You don't owe me anything, you don't owe me anything. Our php project now has 1100 developers.

Chris DiBona: It seems that you have done a good job of transferring jobs.


Leo Laporte: 1100 developers are not a small number.

Rasmus Lerdorf: Yes. If you fix a bug in the PHP project and send a good patch, you are welcome to the PHP community.

Leo Laporte: I know the Perl community has been talking about developing Perl 6 for a long time. I don't know if the horn of PHP 6 has sounded.

Rasmus Lerdorf: we are not very good at market work, but PHP 6 is indeed in progress.

Leo Laporte: Let's talk about this.

Rasmus Lerdorf: The biggest improvement of PHP 6 is Unicode support. PHP 6 any part of the code is based on utf16 encoding.

Leo Laporte: This is probably one of the most rewritten parts of PHP 6.

Rasmus Lerdorf: Yes, Unicode is very difficult. I held a meeting with more than 200 developers who know unicode, including some Japanese developers who work at IBM, I know a lot about ICU projects. ICU is a Unicode project of IBM. At that time, the ICU project was not very good and it was too big. its code is bigger than the PHP source code, which is about 10 times.

Leo Laporte: What do you mean? The ICU project code is 10 times that of PHP.

Rasmus Lerdorf: It's too big, so surprising, and it's not modular, which means you cannot get the part you need from it. but now the ICU has developed, and we can extract what we need, so it is now feasible to add ICU support to the PHP project, which enables PHP to fully support Unicode anywhere, this is the biggest change in Php 6, and the improvements include namespace and other features.

Chris DiBona: Do other libraries need to be rewritten to support unicode?

Rasmus Lerdorf: you are talking about libraries and extensions. Some functions need to be rewritten. Basically, all functions involved in passing strings or operating strings must be reviewed again.Yes, this is a huge workload. there will probably be a Beta Release of alpha at the end of the year. This version just says: Let's take a look and test it to see how many of your existing code cannot run because of this version, it is estimated that most Php 5 code will not have any problems, and we are not worried, maybe you can use it to implement some interesting unicode functions immediately. if you use it correctly, there will be no too much trouble when you are familiar with this version, but there may also be some problems we did not consider, so we hope to release the test as soon as possible, instead of waiting for 5 years in some languages.

Leo Laporte: I run php4 on my server. By the way, I am very grateful for your work and have developed such a good product. like many people, I use Php 4

Rasmus Lerdorf: Well, it does work very well. If you have no need, you can skip the upgrade...

Chris DiBona: fire is terrible (Note: 5 (five) and fire have the same English pronunciation)

Leo Laporte: Haha, yes, I am not afraid of fire. Haha, I just don't want to change the version because it works well now, right?

Rasmus Lerdorf: we should not be afraid to upgrade it until we think we can discard this version. We will continue to provide security patches for php 4. for most products, programs that run well on php 4 should run on php5. the most difficult thing is that large ISPs have hundreds of users and thousands of PHP programs running. If several of them cannot run, it is really terrible for them, if no one complains about the upgrade, you do not have to take the risk of upgrading the version. however, PHP 5 does have some attractive functions, such as simple XML processing support, Soap extension, and fast Soap processing. If your program needs to process Web Services, if you need to parse a large amount of XML, it is quite painful to use PHP 4 for processing. This is the main focus of PHP 5.

Leo Laporte: Well, in order to support PHP 5, I have to re-compile My Apache. Let's talk about it.

Chris DiBona: OK. You will be able to meet me later.

Leo Laporte: The Twit. TV server is down. I will come back later.

Chris DiBona: You can write an email to Rasmus.

Leo Laporte: Can you write code for me? Rasmus

Chris DiBona: It's strange that Drupal seems to be running Php 5?

Leo Laporte: I don't know why I want to run php4. It seems that the latest version of Drupal 5.1.4 supports PHP 5. If there is no special reason, should I switch the program running from PHP 4 to PHP 5?

Rasmus Lerdorf: Well...

Chris DiBona: will it run faster?

Rasmus Lerdorf: Maybe it's not that fast. Some programs run very fast. Some programs run almost the same speed as before, depending on what your code is doing, if your code happens to use the part we optimized a lot of work, the speed will be very fast, otherwise it will be similar to the original speed.

Leo Laporte: Let's talk about some PHP problems that people often talk about. Some people often complain about PHP performance problems. I have never encountered these problems, and PHP's scalability is very good.

Rasmus Lerdorf: You have confused two concepts, so there is no connection between performance and scalability.

Leo Laporte: Right? Let's talk about this.

Rasmus Lerdorf: Yes. The performance is how fast a single server can respond to a single request. scalability refers to the extended width. For example, if you have 0.1 million concurrent accesses, how can you control it under a certain response time.

Leo Laporte: I think both are important, but scalability is more important.

Rasmus Lerdorf: Yes, but in some respects, performance is also very important. You can replace a faster CPU, but it cannot discharge a large number of servers, if the response latency of a single request is half a second, 500 servers are discharged. Unless you have a large number of access requests, the response time of each request is half a second. performance problems are related to response latency. You can serve more requests on a single server, and the scalability is more related to the architecture, you must be sure that what you do is not closely bound to a server. Many of the things we do in PHP have an architecture called "share nothing" (not sharing anything ), like a "PHP black box", you accept a php request and process the request. Anything about the request disappears after the request is completed, there is nothing that can exist across requests. You need to establish such a system. Each request exists independently of each other, because each request may come from different servers, you may have placed 500 servers behind a Server Load balancer program, and the program will run as usual. the PHP Session mechanism is stored in the local tmp directory by default, but we provide a simple mechanism to save the session in the database, so everything we do in php is guaranteed to be scalable, Which is why yahoo and flick programmers use php. because the scalability is built in php. some people say that php is not extensible because they do not know how to implement scalability. for me, we have not encountered any scalability problems, so you may not see our article on scalability. but you can't say that PHP cannot be extended just because we didn't discuss its scalability.

Leo Laporte: Haha

Rasmus Lerdorf: Sometimes this is really a headache. well, there are not many things you can do about performance. PHP, like most scripting languages, can be accessed in two steps. first, compile the text on the disk as op-code, and then pass the op-code to the execution program, which is a bit like the Java bytecode. we can put op-code in the cache. For example, we have used APC for many years and there are other products. they put the compiled op-code in the shared memory. If the php script is requested for the second time, we will see, hi, check the shared memory. This is inode, whether the inode block has been cached in our shared memory. If yes, we can directly execute the op-code of the shared memory, this will increase the code speed by 30 to 40 times.

Leo Laporte: this is a bit similar to python's pyc bytecode, but you have not saved the compiled version on the disk.

Rasmus Lerdorf: Yes, because the slowest performance is to read the disk.

Leo Laporte: this does not save much time, right?

Rasmus Lerdorf: It can't save much. op-code itself is a very small file. 500 bytes and 1000 bytes may all occupy one block in the file system. You can't save much on the size. on the contrary, you should avoid such disk operations. Any such operations are time-consuming. without any copy operation, it is the fastest to execute code directly from the shared memory. if we modify the code on the disk, we need to tell APC that the web server may need to be restarted.

Leo Laporte: In this case, the system needs enough memory to run the program.

Rasmus Lerdorf: cache is used for all high-performance websites.

Leo Laporte: in this case, we will invest more memory for running PHP.

Chris DiBona: So what does Zend provide and a better parser? They are indeed selling performance-optimized products.

Leo Laporte: they also have some caching products.

Rasmus Lerdorf: Similarly, they do not have op-code caching. They also provide cache products for this purpose. You can choose.

Leo Laporte: Do you have your favorite cache products?

Rasmus Lerdorf: What I like most is APC, which is not created by me. It is created by others. I just help them make it run well. I need a cache to start this work.

Leo Laporte: Traditionally, if you run a website with a large access volume, a cache system is usually used.

Rasmus Lerdorf: Yes, you should have one. You can buy it from Zend or try an open-source cache system.

Chris DiBona: What does APC mean?

Rasmus Lerdorf: Alternative PHP Cache, PHP is an open source language, so we need an open source Cache system, APC runs well.

Leo Laporte: Yes. I want to experiment on my server. Let's talk about the security of PHP. What are your security considerations?

Rasmus Lerdorf: I have been talking about PHP security for so many years. I think it is normal that most criticism is unfair to PHP.

Leo Laporte: There are many poor implementations

Rasmus Lerdorf: There are indeed a lot of bad code, and we cannot fix them all. Some errors are indeed our problems, and our programs do have bugs, we will try to fix it correctly. however, there are many issues that we cannot solve in any way. PHP is more prone to this problem than other languages, because it is easier to learn than other languages. That is to say, the more people who lack programming experience use PHP, the more secure some code is indeed written, the structure is not good. the naming of PHP projects is also a problem. People always like to use PHP to name their own projects.

Leo Laporte: yes, baby. This is written in PHP. No other names are needed to name the project.

Leo Laporte: Php Myadmin is also one of them, there are many projects named in this way

Rasmus Lerdorf: Any bug about these projects will come to PHP. If Mailman has a security issue, your first response is not a security issue in Python, at least you can't think about it through name association. You can only say, "Mailman is too stupid." If a PHP project has a problem, they will say: "PHP has another problem. This language is indeed insecure. Let's take a look at these problems"

Leo Laporte: Do you have some perl-like measures to restrict programmers from doing the right programming?

Rasmus Lerdorf: We have many error reporting mechanisms. You can turn on the switch. If you access some unassigned variables, there will be warnings and so on.

Leo Laporte: You work in yahoo

Rasmus Lerdorf: Yes

Leo Laporte: they use a lot of php code. You can talk about where they are developed using php.

Rasmus Lerdorf: almost all yahoo websites have adopted it.

Leo Laporte: Right? This can be used as a good example of php's scalability. Anyone who says php's scalability is poor can go to the yahoo. yahoo email system and use php to write it.

Rasmus Lerdorf: the old version of the mail system is not based on php.

Leo Laporte: is apple's website based on php?

Rasmus Lerdorf: Actually, I don't know.

Leo Laporte: most of them are based on javascript

Rasmus Lerdorf: many apple websites are based on client technologies,I don't know where they use the server-side technology, and the client is not the technology I'm concerned about.

Leo Laporte: I like Yahoo's email system very much. It is a good example of ajax technology. Thank you very much, Rasmus,It provides us with such a good language and can do many powerful things.

Chris DiBona: Very convenient

Leo Laporte: 1100 developers. It's amazing that the php community is really powerful.

Chris DiBona: Pretty Handy Processor (Chris joked about the PHP name)

Leo Laporte: Haha, you are here again, but I like this explanation.

Rasmus Lerdorf: Maybe people hate Perl.

Leo Laporte: Haha, I accept this.

Rasmus Lerdorf: Sorry, Sorry, Larry (founder of Perl)

Leo Laporte: We really want to interview Larry.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.