Closed racheleverett closed 2 years ago
Hi @racheleverett -
I logged into your server and see the following site config for your zipfoods app:
server {
listen 80;
server_name e2zipfoods.racheleverett.me;
root /var/www/e2/zipfoods/public/;
index index.php index.html;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
}
Please update this config so it includes the three lines specific to the location directive as shown in this example:
server {
listen 80;
server_name e2zipfoods.racheleverett.me;
root /var/www/e2/zipfoods/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
}
Ref: https://hesweb.dev/e2/notes/php/frameworks/setup#web-server-setup
The purpose of those three lines is to route all incoming traffic through the index.php file. Without these lines, your routing system in the framework won't work.
After making those changes, don't forget to restart the server.
Give that a shot and if it's still not working let me know!
About and contact pages have started working.
Thank you for the help, appreciate it.
I have successfully set the framework and the index page works great but no matter what I do, no other pages are working, I receive 404 error for all pages like about, contact!
This is my routes file
And AppController
Please help.