This is a REST API for the Analysis I forum written in PHP.
- Clone the repository:
git clone git@github.com:hadriensevel/forum-rest-api.git - Navigate to the project directory:
cd forum-rest-api - Run Composer to install the dependencies:
composer update - Create a MySQL database and import the
database/database.sqlfile. Via command-line, you can do this by running the following command:mysql -u <username> -p <database_name> < database/database.sql - Copy the
config/config.example.phpfile toconfig/config.phpand fill in the configuration with your database credentials and other settings. - Configure your web server. If you're using Apache, add the following lines to your
.htaccessfile located in the project root. If the file doesn't exist, create a new.htaccessfile and add the following content:Note: For other web servers like Nginx, you need to adjust the configuration accordingly. Here is an example for Nginx:RewriteEngine On RewriteCond %{REQUEST_URI} !(\.png|\.jpg|\.webp|\.gif|\.jpeg|\.zip|\.css|\.svg|\.js|\.pdf)$ RewriteRule (.*) routes.php [QSA,L]
location / { try_files $uri $uri/ /routes.php?$query_string; }
- Set the correct file permissions. Ensure that the web server has read access to the project files and write access to the folders where file uploads or caching might occur.