Home >Backend Development >PHP Problem >What to do if var_dump is not formatted in php

What to do if var_dump is not formatted in php

WBOY
WBOYOriginal
2022-05-06 11:12:471923browse

Method: 1. Use "phpinfo()" to obtain the "php.ini" path of the Loaded Configuration File item; 2. Modify the content of the "html_errors" item in the "php.ini" file according to the path and change Change Off to On; 3. Restart Apache.

What to do if var_dump is not formatted in php

The operating environment of this article: Windows 10 system, PHP version 7.1, Dell G3 computer

What to do if var_dump is not formatted in php

The reason why there is no formatted output is because of the php.ini setting problem. You can use the phpinfo() function to see that the html_errors item is set to Off

You need to set this item to on. Make var_dump formatted.

What to do if var_dump is not formatted in php

Method:

1. Use "phpinfo()"

to obtain the file path of php.ini

Look for: Loaded Configuration File

The red box is the specific path of php.ini

What to do if var_dump is not formatted in php

2. Modify the content of the php.ini file

At this time, I thought that there might be a problem with an output configuration in php.ini. I printed phpinfo() to check the configuration one by one, and finally found the php configuration item

html_errors is Off

Change the value of html_errors to On

3. Restart Apache

Problem Solved

Recommended learning: "PHP video tutorial"

The above is the detailed content of What to do if var_dump is not formatted in php. 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