Bug #76194 [Fbk->NoF]: built-in function include_once bug with opcache ext open

From: Date: Sun, 18 Jul 2021 04:22:19 +0000
Subject: Bug #76194 [Fbk->NoF]: built-in function include_once bug with opcache ext open
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-235118@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76194&edit=1

 ID:               76194
 Updated by:       php-bugs@lists.php.net
 Reported by:      415401620 at qq dot com
 Summary:          built-in function include_once bug with opcache ext
                   open
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          opcache
 Operating System: Ubuntu 16.04 LTS
 PHP Version:      7.1.16
 Assigned To:      cmb
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2021-07-08 13:14:25] cmb@php.net

Is this still an issue with any of the actively supported PHP
versions[1]?  Also, are you sure that you don't have file_cache
enabled?

[1] <https://www.php.net/supported-versions.php>

------------------------------------------------------------------------
[2018-04-08 03:21:47] 415401620 at qq dot com

Description:
------------
1. My php.ini file for opcache is the default configuration.
2. Bug description:
When I use include_once to load a config.php file I found that if I delete and recreate the new
config.php file.It will not load the current file and include_once return false.But,it don not load
the current file correctly either.
I use this test script to show what I mean.

There are test steps:

- create a test.php in your web server root path.
- access the test.php with browser
- see the output for get_included_files,it will be :

Array ( [0] => /home/vaxilicaihouxian/codes/php/ect/eastsea.app/test.php ) 123Array ( [0] =>
/home/vaxilicaihouxian/codes/php/ect/eastsea.app/test.php [1] => /tmp/abc.php )

- access the test.php with browser again,the output will be:

123

- remove the /tmp/abc.php with command rm -f /tmp/abc.php
- access the test.php with browser finally and the output is:

Array ( [0] => /home/vaxilicaihouxian/codes/php/ect/eastsea.app/test.php [1] => /tmp/abc.php )
Array ( [0] => /home/vaxilicaihouxian/codes/php/ect/eastsea.app/test.php [1] => /tmp/abc.php )

3. Why there is the /tmp/abc.php in the finally output array of get_included_files()
.It dose not exits but has been included with include_once.
So the second include_once will not work to include my new generating config.php.



Test script:
---------------
<?php
if(!@include_once('/tmp/abc.php')){
    print_r(get_included_files());
    swritefile('/tmp/abc.php','<?php echo 123;');
    include('/tmp/abc.php');
    print_r(get_included_files());
}

function swritefile($filename, $writetext, $openmod='w')
{
    if (@$fp = fopen($filename, $openmod)) {

        flock($fp, 2);

        fwrite($fp, $writetext);

        fclose($fp);

        return true;

    }
}

Expected result:
----------------
It should load the new generating file correctly and not ignore by the first include_once function.

Actual result:
--------------
The second include_once function ignore the config file.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=76194&edit=1


Thread (3 messages)

« previous php.bugs (#235118) next »