Cisco Documentation > Knowledgebase > PHP Websites > Common Errors

Common Errors

Common Errors

There is no doubt you will likely run into some errors when setting up a PHP website with this method, things have to be done a very certain way in a very certain order.


403 Forbidden

This error will most commonly occur when setting the root /var/www/example.com; variable in your server block for your NGINX default file. It most commonly means that the index key from your config file could not be found within your root key of the file.

Make sure you are not using a public_html folder within your domain folder!

Again this is what it looks like in the default file:

server {
    listen 80;
    server_name example.com;
    root /var/www/example.com;
    index index.php;

    location ~ .php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        autoindex on;
        autoindex_exact_size on;
    }
}

The 2 keys you need to be paying attention to are:

root /var/www/example.com;
index index.php;

This would mean that index.php could not be found within /var/www/example.com.


Suggest an edit

Review this page

Cisco