|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71127 Define in auto_prepend_file is overwrite
Submitted: 2015-12-15 14:23 UTC Modified: 2015-12-15 15:10 UTC
From: g dot hue14 at gmail dot com Assigned: laruence (profile)
Status: Closed Package: opcache
PHP Version: 5.6 OS: Debian 8
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
46 - 37 = ?
Subscribe to this entry?

 [2015-12-15 14:23 UTC] g dot hue14 at gmail dot com
Tested with wordpress and apache 2.4 / php-fpm

Define('ABSPATH','mypath') in an auto_prepend_file

When wp-load.php do "define( 'ABSPATH', dirname(__FILE__) . '/' );", my personnal ABSPATH is overwrite with that new ABSPATH.

if i put "get_defined_constants();" in wp-load.php just before "define( 'ABSPATH', dirname(__FILE__) . '/' );", ABSPATH is not overwrite.

if i put "get_defined_constants();" in the auto_prepend_file just after my first define,  ABSPATH is  overwrite when wp-load.php do the define function.

if i put "get_defined_constants();" in a file include between the auto_prend_file and wp-load.php (like index.php or wp-blog-header.php)  ABSPATH is  overwrite when wp-load.php do the define function.

Expected result:
Normally (in php 5.4, php 5.6), a file cannot redefine a constante defined in an auto_prepend_file. 

Actual result:
Constantes defined in an auto_prepend_file can be redefined


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-15 15:00 UTC]
-Package: *General Issues +Package: opcache -PHP Version: 7.0.0 +PHP Version: 5.6 -Assigned To: +Assigned To: laruence
 [2015-12-15 15:00 UTC]
this is a opcache issue...
 [2015-12-15 15:10 UTC]
fix is simple, just disable the constant replace in opcache, but it is a little pity we can not do such optimization :<
 [2015-12-17 06:32 UTC]
Automatic comment on behalf of
Log: Fixed bug #71127 (Define in auto_prepend_file is overwrite)
 [2015-12-17 06:32 UTC]
-Status: Assigned +Status: Closed
 [2023-08-26 16:26 UTC] taiwoemmanueltaiwo59 at yahoo dot com
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 11:01:29 2024 UTC