Some notes for PHP Development

Source: Internet
Author: User
Tags call shell

Use of Linux

Currently, the standard system is Linux + Nginx + PHP + MySQL. More and more large companies are using such configurations. What is different about the configuration is the protocol of a company, for example, mounting is generally divided into two disks,/which is divided into 10 Gb of space allocated to/home. I feel better about this. I used to draw too many items, and secondly, for secure login to the system. Now, small companies or individuals use the network, directly log on to the relay intermediate server using the account or password, but the practice of a relatively large company is to first log on to the relay intermediate server and then log on to the target server through the intermediate server. This way, the account will be recorded and the security is relatively high, currently, the TOKEN and RSASecurID are used for password login, which improves the overall security.

PHP calls shell commands

I haven't used php to call shell to execute some extra tasks before. Now I often use it, so that I can do other things except the script, which is more convenient.

Coding habits for coding habits, each company and team often use different, especially the different programming IDE leads to different coding specifications and different conventions, however, the overall habits have been decided by the resolution of all the team members. This is not strictly required by the original small company, and so is the case now, it seems that this has a lot to do with the team culture. It is natural that people in this team have been familiar with each other for a long time.

Function return value

Generally, false is returned for failed return values. In many cases, int values are returned. If data is returned, array or other values are returned, because of the use of memcache for current functions, many cache operations are used in the function. The returned value is also obtained from the cache first. If it is not obtained from the database, it is written to the cache, then return data

The original writing method for processing data is to write the data in $ _ POST & $ _ GET and then process the data in addslashes. The current method is to directly receive the data, then, determine whether the data meets the requirements, splice the SQL statement, and then process the SQL statement mysql_escape_string. Then, when reading the data, use htmlspecialchars for processing, this shows that there is no problem.

PHP implementation of Lock Mechanism

Some time ago I wrote an article about the PHP implementation of common locks and locks under concurrency.

About queue Distribution

I have used MQ to distribute Memcache data. I have not yet figured out the specific implementation. I have to consult with you.

Understanding of PHP error levels

Originally, for error levels, it was relatively lightweight during development. E_ALL | E_STRICT is now replaced with E_ALL &~ E_STRICT is a good habit of variable definition, and Initialization is necessary during use.

Control over the prevention of illegal information and advertisements by users and the frequency of user behavior

SPAM systems are used to control illegal advertisements published by users to prevent problems and restrict user behaviors, so as to prevent excessive resource control, for variables in the system, the unique ID of auto-increment cannot be used. encryption is required and the returned system information is obtained by others. including user ID and data information ID Encryption

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.