search
HomePHP FrameworkSwooleWhat should I do if swoole phpinfo() does not display?

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!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How can I contribute to the Swoole open-source project?How can I contribute to the Swoole open-source project?Mar 18, 2025 pm 03:58 PM

The 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?How do I extend Swoole with custom modules?Mar 18, 2025 pm 03:57 PM

Article 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?How do I use Swoole's asynchronous I/O features?Mar 18, 2025 pm 03:56 PM

The 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?How do I configure Swoole's process isolation?Mar 18, 2025 pm 03:55 PM

Article 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?How does Swoole's reactor model work under the hood?Mar 18, 2025 pm 03:54 PM

Swoole'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?How do I troubleshoot connection issues in Swoole?Mar 18, 2025 pm 03:53 PM

Article discusses troubleshooting, causes, monitoring, and prevention of connection issues in Swoole, a PHP framework.

What tools can I use to monitor Swoole's performance?What tools can I use to monitor Swoole's performance?Mar 18, 2025 pm 03:52 PM

The 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?How do I resolve memory leaks in Swoole applications?Mar 18, 2025 pm 03:51 PM

Abstract: 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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools