php.ini environment configuration reference plan_PHP tutorial
This article introduces the reference plan for php.ini environment configuration, which will be helpful to many friends. I know that many times, including me, php.ini is the default. Please refer to this article today to deal with it.
The full guide is actually an exaggeration. We will only discuss some configurations that will have an impact on our general development period. Leave other issues to the server managers - we are not network administrators, so we don’t need to Worrying about them should always add some content to their work, right?
代码如下 | 复制代码 |
extension_dir = “/path/to/php” |
The directory where extension libraries (modules) are stored, which is the directory used by PHP to find dynamic extension modules. This is usually in the ext directory under the PHP installation directory (the file name may be different before PHP5). This directory is in the Windows version. PHP stores many .dll files such as php_gd2.dll, php_mysql.dll, etc. This is very important to us. Modify it according to the correct path. Generally write an absolute path, for example: d:php5ext
代码如下 | 复制代码 |
error_reporting = E_ALL & ~E_NOTICE |
Set the level of error reporting. It is recommended to use E_ALL | E_STRICT, which includes all errors warned by code standards. This will help the code we write at the beginning to be standardized code, haha...
There is one more thing to note about bug reporting
代码如下 | 复制代码 |
display_errors = On |
If set to On, the page will display error reports. If set to Off, you will not see error messages even if the level of error reporting is set. As a programmer, there is nothing more troublesome than knowing that there is a problem with the program but not knowing what the problem is.
代码如下 | 复制代码 |
max_execution_time = 30 |
The maximum time a single program script is allowed to occupy the server, in seconds, can avoid inadvertently writing an infinite loop or other programs that occupy the server for a long time and tire the server to death. If the value is set to 0, the running time is not limited.
代码如下 | 复制代码 |
memory_limit = 16M |
The maximum amount of memory that a single program script can occupy, set to -1 to indicate no limit
代码如下 | 复制代码 |
max_input_time = -1 |
The maximum allowed time (seconds) for a single script to parse input data (POST, GET, upload), set to -1 to indicate no limit.
代码如下 | 复制代码 |
post_max_size = 8M |
Maximum byte length allowed for POST data. This setting also affects file uploads. To upload large files, this value must be greater than the value of the upload_max_filesize directive.
If memory limit is enabled, this value should be less than the value of the memory_limit directive.
The code is as follows | Copy code | ||||
upload_max_filesize = 2M
|
The size of the files allowed to be uploaded is two megabytes by default. If you need to upload files larger than 2M, you need to modify this. Of course, you need to modify the values of memory_limit and post_max_size in association.
The code is as follows | Copy code | ||||
upload_tmp_dir =
|
The temporary directory where files are stored when uploading files. This directory must be writable by the PHP process. If not specified, PHP will use the system default temporary directory
The code is as follows | Copy code | ||||
magic_quotes_gpc = On
|
Whether to use automatic string escaping ( ' ” NULL ) for input GET/POST/Cookie data, generally set to On, but in the actual programming environment, do not rely on this setting. Generally, it is necessary to judge the data after Process, look at the code
……
The code is as follows | Copy code | ||||||||
$lastname = addslashes($_POST['lastname']);//Do not manually escape for On } else {$lastname = $_POST['lastname'];//Otherwise use directly }……
|
The code is as follows | Copy code |
mbstring.language = “neutral” |
The default value "neutral" means neutral, equivalent to unknown, "zh-cn" or "Simplified Chinese" means simplified Chinese, "zh-tw" or "Traditional Chinese" means traditional Chinese
…
I don’t want to talk about the rest. If you really need it, let’s talk about it. You can contact me or ask in the group number posted on the top right of the homepage.
Enable extension module instance
The code is as follows
|
Copy code
|
||||
extension=php_gd2.dll, enable the gd library extension, which is used to generate images |
true

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

1. How can you make money by publishing articles on Toutiao today? How to earn more income by publishing articles on Toutiao today! 1. Activate basic rights and interests: original articles can earn profits by advertising, and videos must be original in horizontal screen mode to earn profits. 2. Activate the rights of 100 fans: if the number of fans reaches 100 fans or above, you can get profits from micro headlines, original Q&A creation and Q&A. 3. Insist on original works: Original works include articles, micro headlines, questions, etc., and are required to be more than 300 words. Please note that if illegally plagiarized works are published as original works, credit points will be deducted, and even any profits will be deducted. 4. Verticality: When writing articles in professional fields, you cannot write articles across fields at will. You will not get appropriate recommendations, you will not be able to achieve the professionalism and refinement of your work, and it will be difficult to attract fans and readers. 5. Activity: high activity,

Title: The working principle and configuration method of GDM in Linux systems In Linux operating systems, GDM (GNOMEDisplayManager) is a common display manager used to control graphical user interface (GUI) login and user session management. This article will introduce the working principle and configuration method of GDM, as well as provide specific code examples. 1. Working principle of GDM GDM is the display manager in the GNOME desktop environment. It is responsible for starting the X server and providing the login interface. The user enters

PyCharm is a powerful integrated development environment (IDE), and PyTorch is a popular open source framework in the field of deep learning. In the field of machine learning and deep learning, using PyCharm and PyTorch for development can greatly improve development efficiency and code quality. This article will introduce in detail how to install and configure PyTorch in PyCharm, and attach specific code examples to help readers better utilize the powerful functions of these two. Step 1: Install PyCharm and Python

Understanding Linux Bashrc: Function, Configuration and Usage In Linux systems, Bashrc (BourneAgainShellruncommands) is a very important configuration file, which contains various commands and settings that are automatically run when the system starts. The Bashrc file is usually located in the user's home directory and is a hidden file. Its function is to customize the Bashshell environment for the user. 1. Bashrc function setting environment

As one of the most popular short video platforms in China, Douyin has attracted a large number of users and fans. On TikTok, we often hear about fans and friends, but do you know what the difference is between TikTok fans and friends? This question will be answered in detail below. 1. What is the difference between Douyin fans and friends? On TikTok, fans are people who are interested in your content and choose to follow you. They will interact with you through likes, comments, etc. to establish a virtual connection. Friends, on the other hand, are people who know each other in real life and have real social relationships with each other. On social platforms like Douyin, the methods and depth of interactions between fans and friends may vary, but they are all important elements in building and maintaining a social network. The number of fans refers to those who follow your account

MyBatisGenerator is a code generation tool officially provided by MyBatis, which can help developers quickly generate JavaBeans, Mapper interfaces and XML mapping files that conform to the database table structure. In the process of using MyBatisGenerator for code generation, the setting of configuration parameters is crucial. This article will start from the perspective of configuration parameters and deeply explore the functions of MyBatisGenerator.

How to configure a workgroup in Win11 A workgroup is a way to connect multiple computers in a local area network, which allows files, printers, and other resources to be shared between computers. In Win11 system, configuring a workgroup is very simple, just follow the steps below. Step 1: Open the "Settings" application. First, click the "Start" button of the Win11 system, and then select the "Settings" application in the pop-up menu. You can also use the shortcut "Win+I" to open "Settings". Step 2: Select "System" In the Settings app, you will see multiple options. Please click the "System" option to enter the system settings page. Step 3: Select "About" In the "System" settings page, you will see multiple sub-options. Please click

Flask installation and configuration tutorial: A tool to easily build Python Web applications, specific code examples are required. Introduction: With the increasing popularity of Python, Web development has become one of the necessary skills for Python programmers. To carry out web development in Python, we need to choose a suitable web framework. Among the many Python Web frameworks, Flask is a simple, easy-to-use and flexible framework that is favored by developers. This article will introduce the installation of Flask framework,
