php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70197 Changing php file will give blank page
Submitted: 2015-08-05 23:06 UTC Modified: 2020-10-23 14:28 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:4 (66.7%)
From: venancio1981 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: opcache
PHP Version: 7.0.0beta2 OS: Centos 6.6
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: venancio1981 at gmail dot com
New email:
PHP Version: OS:

 

 [2015-08-05 23:06 UTC] venancio1981 at gmail dot com
Description:
------------
Im testing Invision Power Suit 4 with PHP 7.0.0 Beta 2 and i noticed that everytime i change a php file, my site will return a blank page, till i restart the httpd service.

I suspected this was something related with the Zend Opcache, so i disable it and this did not happen again, so its something with the Opcache.

I cannot replicate this with PHP 5.6 and Zend Opcache 7.0.5.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-08-06 02:48 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-08-06 02:48 UTC] laruence@php.net
is there anything outputted in error log?

and please also check your opcache.file_update_protection configuration
 [2015-08-06 09:01 UTC] venancio1981 at gmail dot com
Nothing appears on the error logs. I might add that i don't need to actually change the code of the php file, i only need to change the timestamp of it to replicate the problem.

The opcache.file_update_protection is set to the default 2 seconds.

I have some more things to add:

- When i replicate the bug, if i reset the cache of the Zend Opcache, it will still not resolve the issue. For now, i found that only restarting the httpd service can fix it.

- Only the site that uses that php file will have the issue. Other php files still works. Its like that file got corrupted in the opcache, so my site can't access it and returns a blank page.

- If i set opcache.validate_timestamps to false, i can't replicate the issue. Which is normal, because the Opcache will not verify the timestamp to recache the file if it changed. But if i reset the cache after changing the timestamp of the php file, i will get the issue again.
 [2015-08-06 11:06 UTC] cmb@php.net
-Status: Feedback +Status: Open
 [2015-08-11 03:15 UTC] laruence@php.net
hmm, by changing a php file, did you use cp or mv?  it's recommended always use mv to update the file.
 [2015-08-11 13:53 UTC] venancio1981 at gmail dot com
Hello,

The way i updated the php files, was with ftp using the protocol SFTP. I just copied the updated PHP files overwriting the old ones.

I can also replicate the issue, if with SFTP i edit a PHP file and save it.

Best Regards
 [2015-08-22 10:32 UTC] venancio1981 at gmail dot com
The bug still happens with the last PHP 7 RC1.

Regards
 [2015-08-26 19:53 UTC] mihor dot cz at gmail dot com
Hello PHP team!

I experienced this bug(?) too!

I just repeatedly experienced (on my demand - with testing) that it's caused by opcache with combination of chaning php files (in my case with `# svn up` command)

Scenario 1: (disabled opcache) - tested multiple times
upping PHP code with svn (up and down to specific revision)
Everything is working fine every time.

Scenario 2: (enabled opcache) - tested multiple times
upping PHP code with svn (up and down to specific revision) or chaning it via Sublime+ExpanDrive connected to Linux server via SSH

I repeatedly uninstalled opcache and tested (scenario 1) and then installed opcache and tested (scenario 2) and then again uninstalled, installed etc etc and every time same result.

Error is like this:
Fatal error: Class 'MyClass' not found in /var/www/html/project/classes/MyClassExtension.php on line 8

System: CentOS 6
PHP version: 7.0.0RC1
 [2015-08-27 04:27 UTC] mihor dot cz at gmail dot com
*changing php files (not chaning php files - sorry for that typo)

I forgot to mention three things:

1) Scenario 2 always! caused fatal error

2) Same as venancio1981 - after fatal error I have to restart apache service to solve the problem (temporarily till next change)

3) Same as venancio1981 - PHP 5.6.12 with opcache enabled is working fine
 [2015-09-09 15:03 UTC] mihor dot cz at gmail dot com
It seems like it's fixed in PHP 7 RC2.
Can somebody please check it as well?

Thank you
 [2015-09-09 15:08 UTC] venancio1981 at gmail dot com
Yes, it seems fixed in RC2
 [2015-10-06 13:19 UTC] venancio1981 at gmail dot com
Im having this bug again in RC4.
There was some kind of regression?
 [2015-10-20 22:56 UTC] contact at sleeklane dot com
I'm also seeing this on RC4.

But I do not need to edit a file to get the blank page on Invision Power Suit 4, All I need to do is enable opcache then refresh the page a couple times and I get a blank page no error's nothing in the logs. once I have the blank page after a couple more refreshes it comes back but then goes blank again after more refreshes of the page.
 [2020-10-23 14:04 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-10-23 14:04 UTC] cmb@php.net
Does this still happen with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2020-10-23 14:17 UTC] venancio1981 at gmail dot com
I cant replicate this bug for a very long time. I can't remember when it was fixed, but it's not an issue anymore.
 [2020-10-23 14:28 UTC] cmb@php.net
Great!  Thanks for the swift reply.
 [2020-10-23 14:28 UTC] cmb@php.net
-Status: Feedback +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 03 13:01:28 2024 UTC