What should I do if swoole phpinfo() does not display?

1. Problem description
Written a php file test.php, the code is as follows:
<?php
echo phpinfo();
?>The browser visited it, but returned NULL.
2. Problem location and solution
After checking online, the problem encountered by most people is actually short_open_tags problem. Their code is as follows:
<?
echo phpinfo();
?>In this case, you need to open short_open_tags in php.ini, and then reload the php.ini service and it will be OK.
There are two more questions here. One is how to know which php.ini file is loaded by php execution. You can execute it on the command line: php --ini to find the php.ini file; the other is how to Reload the php.ini file. If php-fpm is enabled on your server, generally speaking, restarting php-fpm will be OK. The command is: service php-fmp restart. If the php-fpm service is not enabled (earlier version) php), generally restarting the apache service is OK, the command is service httpd restart.
After following the above steps, the problems encountered by most people will be solved, but this is other people's problems, not mine orz...
Helpless, I felt that this thing must be related to the configuration of php, so I went to the official website to read the php.ini document. The following configuration is as follows:
disable_functions string
This command Allows you to disable certain functions for security reasons. Accepts a comma separated list of function names as arguments. disable_functions is not affected by safe mode. This directive can only be set in php.ini. For example, it cannot be set in httpd.conf
, which means that some methods can be configured in php.ini, but these methods cannot be called. Open php.ini to find this configuration. Sure enough, the phpinfo() method is disabled. As follows:
disable_functions = phpinfo,system,proc_open,proc_close,show_source,popen,pclose
It suddenly dawned on me that I temporarily deleted the phpinfo() method from disable_functions, reloaded the php.ini file, and then accessed test.php from the browser again. This time it was successful. Problem solve. However, I would like to remind my friends that phpinfo() is very sensitive information. It is usually best not to expose it to the client, so I quickly turned it off after the test.
PHP Chinese website has a large number of free Swoole introductory tutorials, everyone is welcome to learn!
The above is the detailed content of What should I do if swoole phpinfo() does not display?. For more information, please follow other related articles on the PHP Chinese website!
How can I contribute to the Swoole open-source project?Mar 18, 2025 pm 03:58 PMThe article outlines ways to contribute to the Swoole project, including reporting bugs, submitting features, coding, and improving documentation. It discusses required skills and steps for beginners to start contributing, and how to find pressing is
How do I extend Swoole with custom modules?Mar 18, 2025 pm 03:57 PMArticle discusses extending Swoole with custom modules, detailing steps, best practices, and troubleshooting. Main focus is enhancing functionality and integration.
How do I use Swoole's asynchronous I/O features?Mar 18, 2025 pm 03:56 PMThe article discusses using Swoole's asynchronous I/O features in PHP for high-performance applications. It covers installation, server setup, and optimization strategies.Word count: 159
How do I configure Swoole's process isolation?Mar 18, 2025 pm 03:55 PMArticle discusses configuring Swoole's process isolation, its benefits like improved stability and security, and troubleshooting methods.Character count: 159
How does Swoole's reactor model work under the hood?Mar 18, 2025 pm 03:54 PMSwoole's reactor model uses an event-driven, non-blocking I/O architecture to efficiently manage high-concurrency scenarios, optimizing performance through various techniques.(159 characters)
How do I troubleshoot connection issues in Swoole?Mar 18, 2025 pm 03:53 PMArticle discusses troubleshooting, causes, monitoring, and prevention of connection issues in Swoole, a PHP framework.
What tools can I use to monitor Swoole's performance?Mar 18, 2025 pm 03:52 PMThe article discusses tools and best practices for monitoring and optimizing Swoole's performance, and troubleshooting methods for performance issues.
How do I resolve memory leaks in Swoole applications?Mar 18, 2025 pm 03:51 PMAbstract: The article discusses resolving memory leaks in Swoole applications through identification, isolation, and fixing, emphasizing common causes like improper resource management and unmanaged coroutines. Tools like Swoole Tracker and Valgrind


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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

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

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools






