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!

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

SublimeText3 Linux new version
SublimeText3 Linux latest version

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

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