Intermittent "require() Failed to open stream" err

Support/Development for PHP
AndraX2000
Forum User
Forum User
Posts: 15
Joined: Thu Dec 20, 2007 7:17 pm

Intermittent "require() Failed to open stream" err

Unread post by AndraX2000 »

After upgrading from 8.2.1 to 8.3.0 I began getting intermittent 501 errors. Restarting apache will fix the problem for several hours, but then it starts again.

If I visit a page that has one of the 501 errors, and refresh it several times, it will eventually show. It seems that the error occurs about 75% of the time once it begins happening.

The files that it claims are not there are there and have 644 permission.
[Fri Jan 04 12:38:22 2008] [error] [client 65.60.231.37] PHP Warning: require(template.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/gantzfamilyreunion.net/httpdocs/index.php on line 78
[Fri Jan 04 12:38:22 2008] [error] [client 65.60.231.37] PHP Warning: require(template.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /var/www/vhosts/gantzfamilyreunion.net/httpdocs/index.php on line 78
[Fri Jan 04 12:38:22 2008] [error] [client 65.60.231.37] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'template.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/gantzfamilyreunion.net/httpdocs/index.php on line 78

I am using centos4, plesk 8.3.0.
yum update tells me that no packages are marked for update

php-5.2.5-2.el4.art
httpd-2.0.52-38.ent.centos4
psa-8.3.0-cos4.build83071218.20
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

Is it always the same files? Or does it change periodically?
AndraX2000
Forum User
Forum User
Posts: 15
Joined: Thu Dec 20, 2007 7:17 pm

Unread post by AndraX2000 »

It happens on any domain with php of even mild complexity. Once the 501 errors happen on one domain, it affects almost all the domains on the server.
I just sampled the error logs of one of the domains.

On the same domain, viewing the same page, the error is always the same. All includes fail (generating warnings) and the script stops executing at the first require.

Here's a different domain's log:
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Warning: main(extensions/modules.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/webonizer.php on line 0
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'extensions/modules.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/webonizer.php on line 0
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Warning: main(extensions/myGroups.php) [<a href='function.main'>function.main</a>]: failed to open stream: No such file or directory in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/webonizer.php on line 0
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Warning: main() [<a href='function.include'>function.include</a>]: Failed opening 'extensions/myGroups.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/webonizer.php on line 0
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Notice: Undefined index: smo_uid in /var/www/vhosts/2142tactics.com/httpdocs/index.php on line 16
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Notice: Undefined index: smo_permit in /var/www/vhosts/2142tactics.com/httpdocs/index.php on line 16
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Notice: Undefined index: smo_permit in /var/www/vhosts/2142tactics.com/httpdocs/index.php on line 19
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Notice: Undefined index: smo_uid in /var/www/vhosts/2142tactics.com/httpdocs/index.php on line 19
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Warning: include_once(googleFuncs.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/templates/template.inc on line 32
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'googleFuncs.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/templates/template.inc on line 32
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Warning: require_once(linkcol.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/templates/template.inc on line 57
[Fri Jan 04 14:41:35 2008] [error] [client 65.60.231.37] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'linkcol.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/vhosts/2142tactics.com/httpdocs/webonizer_core/templates/template.inc on line 57
The notices are caused because the include failed, so those variables have not been set.

This effects both ioncube encoded and normal non-encoded sites.

Thanks for your help, Scott.
AndraX2000
Forum User
Forum User
Posts: 15
Joined: Thu Dec 20, 2007 7:17 pm

Unread post by AndraX2000 »

I found the problem. This problem only effects sites that use set_include_path() or ini_set() to set include_path.

When Horde Imp webmail is run, it mucked about with the include path, and then all other sites that wanted to set the include path stopped working.

Changing php_admin_value to php_value on include_path lines in /etc/httpd/conf.d/zz010_psa_httpd.conf fixed this.

I was under the impression that 8.3.0 was supposed to fix the issues with php_admin_value and webmail, but apparently it solved those by creating new ones. That means that every time psa rewrites zz010_psa_httpd.conf this line will have to be corrected.
scott
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
Posts: 8355
Joined: Wed Dec 31, 1969 8:00 pm
Location: earth
Contact:

Unread post by scott »

are you using php_admin_value in any of your vhost.conf files? Basically the behavior of php_admin_value itself has changed in PHP 5.2.5 and 4.4.7 (reported by 1 person so far). Once called, whatever it is used on becomes immutable.
exi1ed0ne
Forum Regular
Forum Regular
Posts: 190
Joined: Sun Nov 20, 2005 4:16 pm
Location: Right Behind You!
Contact:

Unread post by exi1ed0ne »

I've been seeing the same issue here, and it was driving me crazy since it was intermittent. There is nothing in my vhosts.conf files for php_admin_value, and changing to php_value fixes it.

One workaround would be to create a new conf file that aliases horde inside one of your domains. Plesk doesn't touch that. I do this to ensure those users without an SSL certificate for their domain can still enjoy and encrypted session. It won't stop the server breaking when people go to webmail.* though if the zz010_psa_httpd.conf file is changed.
AndraX2000
Forum User
Forum User
Posts: 15
Joined: Thu Dec 20, 2007 7:17 pm

Unread post by AndraX2000 »

scott wrote:are you using php_admin_value in any of your vhost.conf files? Basically the behavior of php_admin_value itself has changed in PHP 5.2.5 and 4.4.7 (reported by 1 person so far). Once called, whatever it is used on becomes immutable.
I have no vhost.conf files.

I submitted a bug report to PHP. It seems to me that php_admin_value in one VirtualHost should only apply to that VirtualHost. But if they believe that is should apply to all of the VirtualHosts, that should be documented, and it should be immediate, not based on which VirtualHost called it first.

http://bugs.php.net/bug.php?id=43755

The bug report only mentions include_path, because I have not tested it to see if it applies to all values set with php_admin_value.
Post Reply