Ok, so if this is your code as you provided, then the issue is simple:
require_once(__DIR__."/recources/utils.class.php") //<-- no semi colon
include(__DIR__."/resources/pagehead.php");
You missed a semi colon at the end of the require_once line.
PHP error reporting is precise in what it states. PHP doesn't lie, even if the actual issue in your code is not the error and/or line PHP has stated in the error.
"unexpected" anything in PHP errors is usually straight cut, in that it was expecting something before whatever is mentioned in the error.
In this case, unexpected 'unexpected T_INCLUDE' your line above was missing a semi-colon.
Adding to the whole scenario, and that you just need to include a file from a specific location, is __DIR__
what you need?
This will return the directory of the file, and if __DIR__
is used inside an include file, the directory of the included file is returned.
If your PHP version is too old and cannot be updated, you'll have to explicitly list the full path.
Alternatively, if you have a bootstrap type file (included in all scripts) you could define something there, if it's worthwhile and used often enough.