php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Generating a valgrind logImportant!To get a meaningful log you must have PHP configured with--enable-debug
and disable Zend memory manager.
Disabling Zend MMZend Engine uses its own routines to optimize memory management, but because of this valgrind cannot see most of the memory issues. You must disable Zend memory manager before running PHP with valgrind. In order to do this you need to set USE_ZEND_ALLOC environment variable to 0. Use
or
(the syntax depends on what your shell supports).
This works since PHP 5.2, in older versions you had to reconfigure PHP with
Using Shared ExtensionsTo correctly show the stack frames for extensions compiled as shared libraries, set: or
(the syntax depends on
what your shell supports).
This works from PHP 5.3.11 onwards. Running PHP CLI, Built-in Web Server or PHP CGI through valgrindTo generate the valgrind log using PHP CLI/CGI, you need to execute the following command:
This should put the log into php.log file in the current working directory. To valgrind the built-in web server, use the appropriate -S and -t options to the CLI executable. Run your application via a browser and review php.log for any valgrind errors. Running PHP Apache module through valgrind If you compiled PHP and Apache statically, make sure the Apache binary is
not stripped after
To generate the valgrind log using PHP as Apache module, you need to run the Apache itself under valgrind:
Run your application via a browser. All the memory errors will be in apache.log. |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Mon Nov 04 22:01:28 2024 UTC |