C.Sheep C.Sheep - 1 year ago 59
PHP Question

Require() file stopped working after update to php56

After updating to PHP version 5.6.23,

stopped working for files that are rewritten in
. The page works fine when requiring the actual file

I did try updating composer.

Error message:

Fatal error: require(): Failed opening required 'staffHelp' (include_path='.:/usr/local/php56/pear') in /home/mittensl/public_html/Staff-Lounge.php on line 3

Rewrite engine works for every other file (I haven't discovered any errors yet):

RewriteEngine On
RewriteRule ^staffHelp/?$ Qb0XTST.php [NC,L]

Answer Source

require (and include) has nothing to do with Apache's mod_rewrite. It looks for the path given and not for some rewritten URL.

The error message confirms this. require('staffHelp'); looks for a file staffHelp, and does not involve Apache's rewrite rules in any way.

Apache's rewrite rules will be applied only, when there's an HTTP request coming in, which doesn't happen, when PHP requires or includes a file.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download