Close method: In the php.ini configuration file, look for "safe_mode =" and set it to "safe_mode = Off"; then restart php, or restart the entire environment to turn off php safe_mode mode (safe mode) .
How to turn off the safe_mode mode of php
Some environments turn on the safe mode (safe_mode), which will cause Many PHP built-in functions of the program cannot be used, and the system will be paralyzed. It is recommended to close it.
Set safe_mode = Off
in the php.ini file, and then restart php, or restart the entire environment. [Related tutorial recommendations: "PHP Tutorial"]
As shown in the picture:
##Expand information
What is PHP safe mode: safe_mode
Simply put, PHP safe mode is to run php in safe mode. php's safe mode provides a basic secure shared environment on a php open web server where multiple user accounts exist. When PHP is running in safe mode on a web server, some functions will be completely disabled and some available functions will be limited. In safe mode, some functions that try to access the file system will be restricted. Running the web server user ID, if you want to operate a certain file, you must have read or write access rights to the file. There is no problem for PHP to implement this restriction function. When safe mode is turned on, when trying to read or write a local file, PHP will check whether the current accessing user is the owner of the target file. If you are not the owner, the operation will be disabled. (Writing permissions: Under lower-level file access permissions, it may be allowed to read or write files in the system operating system. This is achieved through PHP's safe mode to prevent you from operating another user's files. Operation. Of course, a web server may be able to access an arbitrary file with global write permission.)When safe mode is turned on, the functionality of the following function list will be restricted:chdir, move_uploaded_file, chgrp, parse_ini_file, chown, rmdir, copy, rename, fopen, require, highlight_file, show_source, include, symlink, link, touch, mkdir, unlinkSame, Some functions in PHP extensions will also be affected. (Loading module: The dl function will be prohibited in safe mode. If you want to load an extension, you can only modify the extension options in php.ini and load it when PHP starts) Opened in PHP safe mode When you need to execute a system program, it must be the program in the directory specified in the safe_mode_exec_dir option, otherwise the execution will fail. Even if execution is allowed, it will automatically be passed to the escapeshellcmd function for filtering. The following function list for executing commands will be affected: exec,shell_exec,passthru,system,popenIn addition, the back marking operator (`) will also be affected closure. When running in safe mode, although no error will be caused, the putenv function will be invalid. Similarly, other functions set_time_limit and set_include_path that try to change PHP environment variables will also be ignored. Recommended learning:
PHP programming from entry to proficiency
The above is the detailed content of How to turn off php's safe_mode mode?. For more information, please follow other related articles on the PHP Chinese website!

The article compares ACID and BASE database models, detailing their characteristics and appropriate use cases. ACID prioritizes data integrity and consistency, suitable for financial and e-commerce applications, while BASE focuses on availability and

The article discusses securing PHP file uploads to prevent vulnerabilities like code injection. It focuses on file type validation, secure storage, and error handling to enhance application security.

Article discusses best practices for PHP input validation to enhance security, focusing on techniques like using built-in functions, whitelist approach, and server-side validation.

The article discusses strategies for implementing API rate limiting in PHP, including algorithms like Token Bucket and Leaky Bucket, and using libraries like symfony/rate-limiter. It also covers monitoring, dynamically adjusting rate limits, and hand

The article discusses the benefits of using password_hash and password_verify in PHP for securing passwords. The main argument is that these functions enhance password protection through automatic salt generation, strong hashing algorithms, and secur

The article discusses OWASP Top 10 vulnerabilities in PHP and mitigation strategies. Key issues include injection, broken authentication, and XSS, with recommended tools for monitoring and securing PHP applications.

The article discusses strategies to prevent XSS attacks in PHP, focusing on input sanitization, output encoding, and using security-enhancing libraries and frameworks.

The article discusses the use of interfaces and abstract classes in PHP, focusing on when to use each. Interfaces define a contract without implementation, suitable for unrelated classes and multiple inheritance. Abstract classes provide common funct


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Chinese version
Chinese version, very easy to use

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