Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Error prompt on how to turn on php by ngnix

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "ngnix how to open php error tips", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "ngnix how to open php error tips" bar!

This article operating environment: nginx1.0.4 system, PHP7.2 version, DELL G3 computer

Nginx turns on PHP error message

In the process of using nginx, you will always encounter nginx prompt 500error, but the specific error needs to check the error log file, which is very inconvenient. Opening the error page prompt is useful when debugging PHP, but it is not recommended for online servers to enable this feature.

Profile about PHP fpm mode and cli mode may be two configuration files, both of which need to be modified

Execute commands in CLI mode

Php phpinfo.php

View environment variabl

Server API = > Command Line InterfaceVirtual Directory Support = > disabledConfiguration File (php.ini) Path = > / etc/php/7.2/cliLoaded Configuration File = > / etc/php/7.2/cli/php.iniScan this dir for additional .ini files = > / etc/php/7.2/cli/conf.d

First, edit the php configuration file:

Vi / etc/php.inierror_reporting = E_ALLdisplay_errors = On

Because I turned on php-fpm. So you have to edit nginx's fpm configuration file.

Vim / etc/php/7.2/fpm/pool.d/www.confphp_ values [display _ errors] = on;php_admin_ value [error _ log] = / data/www/log/error.log; php_admin_ values [log _ errors] = on

Restart php-fpm and nginx. In this way, the errors in php can be displayed in the browser during development, which is very convenient.

Thank you for your reading, the above is the content of "ngnix how to open the error prompt of php". After the study of this article, I believe you have a deeper understanding of the problem of how to open the error prompt of php in ngnix, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report