I have a server, and I decided to update the OS, php was also updated from php5 to php7. In the web pages, I have includes to get layout info. like this:
<html><body>
<?php include "scripts/sidebar.php";?>
</body></html>
(For example). The php files individually work, but the web pages do not INCLUDE the files in the include statements. Formerly, this had been working. I have looked for errors in /var/log/nginx/error.log and /var/log/nginx/access.log, there are none. There are also no errors in /var/log/php7.0-fpm.log
I tried changing the php.ini file variable "include_path" to point to the location of the scripts, (and reload nginx and php), but this had no effect.
I tried setting "allow_url_include = On" as described in the PHP documentation: http://php.net/manual/en/filesystem.configuration.php After restarting php, and nginx, this seemed to have no effect.
What can I do to make the <?php include 'scripts/sidebar.php';?>
function work?
if you can use like this.
include_once './test.php';
all files in same directory
You have not mentioned your file name from where you are including the php file, if your file extension is php then it will work.
Try to use
<?php include_once(dirname(__FILE__)."/scripts/sidebar.php"); ?>