I am making a php website with a simple php website template
This is the index.php looks like
require './config.php';
require './functions.php';
//echo 'hello';
run();
the run() function is in functions.php
function run() {
include config('template_path') . '/template2.php';
}
and this is template2.php file
include 'header.php';
pageContent();
include 'footer.php';
When I run the site in localhost using WAMP server, it works perfectly without any problem.
But when I upload this project into the amazon server , the server returns HTTP 500 error. When I comment the require statements , the page works(displays hello). I am a php beginner and I have no idea whats the problem and need help.
This is the .htaccess file
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?page=$1 [L]
config .php
<?php
/**
* Used to store website configuration information.
*
* @var string
*/
function config($key = '') {
$config = [
'name' => 'Test',
'nav_menu' => [
'home' => 'Home',
'about-us' => 'About Us',
'portfolio-works' => 'Portfolio',
'contact' => 'Contact',
],
'portfolio' => [
[ 'Test','Test', "assets/img/portfolio/test.jpg",'movie'],
['Test','test1', "assets/img/portfolio/test.jpg",'documentary'],
['Test','test2', "assets/img/portfolio/test.jpg",'advertisement'],
],
'template_path' => 'template',
'content_path' => 'content',
'pretty_uri' => true,
'version' => 'v2.0',
'link' => '/peekay',
'about_us' => 'Lorem ipsum',
];
return isset($config[$key]) ? $config[$key] : null;
}