php function cannot be used?
Problem Description
Why is PHP unable to execute the system() function?
Question Answer
PHP cannot execute the system() function. There may be the following situations:
(1) Warning: system() has been disabled for security reasons
This error is due to the server security configuration turning off the system function. Open the php.ini file and remove the system after the disable_functions equal sign.
(2)Warning: system() [function.system]: Unable to fork
This error is due to the current site’s running account being unable to access cmd.exe and finding Windows\system32\cmd .exe attribute, just add the running account permissions of the current site or the users group permissions.
(3) There is no response or error when executed under Web access, but the result can be returned normally when executed using the php cli command line. This error is generally caused by the Windows system path. The program may use Use the absolute path to access the program, for example:
system('D:\server\DLL\IECapt.exe --url=http://tech.cncms.com --out="D:\web\tt.fei.cn\htdocs\ttt\tech.png"');
At this time, the command line execution result is correct, but the Web access will return a blank page without errors.
Modification method: Change the access path of the file to a relative path, copy IECapt.exe to the current directory of the site program, and change the code to:
system('IECapt.exe --url=http://www.baidu.com --out=t/tech.png');
3 Visit the page again, You can output normally.
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of php function cannot be used. 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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version
Recommended: Win version, supports code prompts!

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.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Dreamweaver CS6
Visual web development tools
