XDebug 自動(dòng)開(kāi)啟PHP Stack Trace, 導(dǎo)致PHP Log 超1G
Jun 13, 2016 am 09:35 AM昨天早上突然發(fā)現(xiàn)測(cè)試服務(wù)器空間滿了,用du挨個(gè)文件夾查看,發(fā)現(xiàn)是php debug log占地極大,有的log直接有1G,打開(kāi)后發(fā)現(xiàn)極其多的php stack trace.
立刻到主服務(wù)器查看,主服務(wù)器日志也400多M的日志,幸好主服務(wù)器空間足夠。
?
那么多stack trace,可以肯定之前是沒(méi)有的,挨個(gè)查看日志,是某一天早上一個(gè)時(shí)刻發(fā)生的。
解決方案:
1. 難道是之前升級(jí)php導(dǎo)致,到網(wǎng)上搜索php stack trace,所有的都是顯示如何打開(kāi),卻沒(méi)有如何關(guān)閉的。仔細(xì)查找php的參數(shù),只找到ignore_repeated_sources和ignore_repeated_error這兩個(gè)看似有關(guān)的東西,更改后也不頂用。
2. 如果不是升級(jí)php所致,再仔細(xì)想這幾天做了什么 改動(dòng),哪些是和php trace有關(guān)的,想起xdebug. ,先嘗試把xdebug刪除,OK,問(wèn)題消失了??隙ㄊ莤debug的問(wèn)題了,開(kāi)始的時(shí)候沒(méi)有直接找xdebug的官方文檔,利用phpinfo把xdebug所有的參數(shù)都打出來(lái),先猜是哪個(gè)參數(shù),試了幾個(gè)都不頂用, 后來(lái)才靜下心來(lái)看看xdebug的官方文檔吧,發(fā)現(xiàn)了如下話語(yǔ):
?Stack Traces
When Xdebug is activated it will show a stack trace whenever PHP decides to show a notice, warning, error etc. The information that stack traces display, and the way how they are presented, can be configured to suit your needs.
有戲,再繼續(xù)找,發(fā)現(xiàn)了一個(gè)名稱和用途你如何也聯(lián)系不上的變量"xdebug.default_enable",還真就是這個(gè)參數(shù)來(lái)控制了,如下。
xdebug.default_enableType:?boolean, Default value:?1
If this setting is 1, then stacktraces will be shown by default on an error event. You can disable showing stacktraces from your code withxdebug_disable(). As this is one of the basic functions of Xdebug, it is advisable to leave this setting set to 1. ? 這個(gè)問(wèn)題幾乎折騰一天,心得:碰到意外問(wèn)題時(shí)要冷靜,雖然影響了多原有計(jì)劃,但如果問(wèn)題是嚴(yán)重的問(wèn)題就一定要排除萬(wàn)難先解決了再說(shuō),不然會(huì)形成習(xí)慣。另外,使用一些現(xiàn)成功能模塊時(shí),在在最衩進(jìn)行搜索無(wú)果后,得靜下心來(lái)仔細(xì)閱讀官方文檔。
Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to reconnect to MySQL in ASP.NET program? In ASP.NET development, it is very common to use the MySQL database. However, due to network or database server reasons, the database connection may sometimes be interrupted or time out. In this case, in order to ensure the stability and reliability of the program, we need to re-establish the connection after the connection is disconnected. This article will introduce how to reconnect MySQL connections in ASP.NET programs. To reference the necessary namespaces first, reference them at the head of the code file

The combination of Vue.js and ASP.NET provides tips and suggestions for performance optimization and expansion of web applications. With the rapid development of web applications, performance optimization has become an indispensable and important task for developers. As a popular front-end framework, Vue.js combined with ASP.NET can help us achieve better performance optimization and expansion. This article will introduce some tips and suggestions, and provide some code examples. 1. Reduce HTTP requests The number of HTTP requests directly affects the loading speed of web applications. pass

Translator | Reviewed by Chen Jun | Chonglou In the 1990s, when people mentioned software programming, it usually meant choosing an editor, checking the code into the CVS or SVN code base, and then compiling the code into an executable file. Corresponding integrated development environments (IDEs) such as Eclipse and Visual Studio can integrate programming, development, documentation, construction, testing, deployment and other steps into a complete software development life cycle (SDLC), thus improving the work of developers. efficiency. In recent years, popular cloud computing and DevSecOps automation tools have improved developers' comprehensive capabilities, making it easier for more enterprises to develop, deploy and maintain software applications. Today, generative AI is the next generation development

How to correctly use and optimize the MySQL connection pool in ASP.NET programs? Introduction: MySQL is a widely used database management system that features high performance, reliability, and ease of use. In ASP.NET development, using MySQL database for data storage is a common requirement. In order to improve the efficiency and performance of database connections, we need to correctly use and optimize the MySQL connection pool. This article will introduce how to correctly use and optimize the MySQL connection pool in ASP.NET programs.

The combination of Vue.js and ASP.NET enables the development and deployment of enterprise-level applications. In today's rapidly developing Internet technology field, the development and deployment of enterprise-level applications has become more and more important. Vue.js and ASP.NET are two technologies widely used in front-end and back-end development. Combining them can bring many advantages to the development and deployment of enterprise-level applications. This article will introduce how to use Vue.js and ASP.NET to develop and deploy enterprise-level applications through code examples. First, we need to install

How to correctly configure and use MySQL connection pool in ASP.NET program? With the development of the Internet and the increase in data volume, the demand for database access and connections is also increasing. In order to improve the performance and stability of the database, connection pooling has become an essential technology. This article mainly introduces how to correctly configure and use the MySQL connection pool in ASP.NET programs to improve the efficiency and response speed of the database. 1. The concept and function of connection pooling. Connection pooling is a technology that reuses database connections. At the beginning of the program,

Overview of the recommended configuration for using Visual Studio for ASP.NET development on Linux: With the development of open source software and the popularity of the Linux operating system, more and more developers are beginning to develop ASP.NET on Linux. As a powerful development tool, Visual Studio has always occupied a dominant position on the Windows platform. This article will introduce how to configure VisualStudio for ASP.NE on Linux

How to correctly use and optimize the transaction performance of MySQL connection pool in ASP.NET programs? In ASP.NET programs, database transactions are a very important part. Transactions ensure the consistency and integrity of the database while also providing better performance. When using a MySQL database, it is essential to use connection pools to manage connection resources and optimize performance. First, let us briefly understand the concept of MySQL connection pool. The connection pool is a buffer pool of a group of connections. By pre-initializing a certain number of
