Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to parse PHP and configuration files

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to parse PHP and configuration files, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

What is PHP?

PHP, the abbreviation of Hypertext Preprocessor hypertext preprocessor, is a widely used server-side programming language for the development of dynamic web pages, and is one of the most widely used languages in dynamic web page development.

To put it simply, PHP is a Web server-side development language for rapid dynamic web page development.

Its features include:

(1) Open source, cross-platform, architecture-independent

(2) interpretive, object-oriented and database support

(3) Fast, easy to learn, robust, safe and superior performance.

Similar development languages are ASP and JSP.

PHP, ASP and JSP have rapidly become the mainstream Web server-side development languages because of their excellent performance and powerful database operation functions.

The combination of PHP+Apache+MySQL (all open source) is a completely free and high-performance combination of Web server application development, which has become an application solution for the vast majority of small and medium-sized websites.

The early Web application server programs wrote CGI (common Gateway Interface, Common Gateway Interface) programs directly in Perl or C language, or made use of the API of Web server, or adopted third-party solutions. These methods have their own strengths, but they can not meet the growing needs of Web applications in terms of running speed and database operation.

PHP is mainly used in the following three application areas:

(1) Server-side script program

(2) Command line script

(3) Desktop applications

Writing server-side scripts using PHP is the most commonly used application area of PHP.

The workflow of the PHP program

(the following figure is from the network)

Web server: generally choose open source Apache or Nginx

Database: generally choose open source MySQL

PHP interpreter: PHP package

Deployment on Linux and Windows platforms is common.

There are corresponding integrated installation packages, such as LAMP and LNMP of WAMP,Linux platform of Windows platform.

PHP configuration file parsing PHP configuration file php.ini is read when PHP starts.

For PHP, which is the version of the Web server module, it is read only once when the Web server starts.

The search path for php.ini in Windows environment is as follows (in order):

(1) the path specified by PHPIniDir in Apache configuration file httpd.conf

(2) HKEY_LOCAL_MACHINE\ SOFTWARE\ PHP\ IniFilePath (i.e. Windows registry location)

(3) PHPRC environment variable

(4) Web server directory or directory where PHP is located (other cases under Windows)

(5) Windows directory (c:\ windows or c:\ winnt)

You can determine which PHP configuration file the server is currently reading by the value of the Loaded Configuration File entry in the output page of info.php. As shown in the following figure:

Parameters to pay attention to:

Extension_dir

PHP searches for the location of the extension library. PHP extension libraries are generally placed in the ext folder under the PHP directory and are a set of .DLL dynamic link library files.

Short_open_tag (Boolean)

Determines whether the abbreviated form of the start flag in PHP code is allowed ().

If you want to use it with XML, you can disable this option to facilitate embedding.

If not, you can output it through PHP, for example:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report