I completed the search.php file, but when I try to run it, I get this error:
Warning: file_get_contents(/home/ubuntu/workspace/pset8/includes/../config.json): failed to open stream: Permission denied in /home/ubuntu/workspace/pset8/vendor/library50-php-5/CS50/CS50.php on line 95
Fatal error: Could not read /home/ubuntu/workspace/pset8/includes/../config.json in /home/ubuntu/workspace/pset8/vendor/library50-php-5/CS50/CS50.php on line 98
When I open my website, the permissions are fine for the home page, so I am not sure if this is a problem with my search.php or with the permissions.
This is my search.php file:
<?php
require(__DIR__ . "/../includes/config.php");
$places = [];
$places = query("SELECT * FROM places WHERE MATCH(postal_code, place_name, admin_name1)
AGAINST (?) LIMIT 20", $_GET["geo"]);
header("Content-type: application/json");
print(json_encode($places, JSON_PRETTY_PRINT));
?>
Any help is very much appreciated!