Welcome! Log In Create A New Profile


help with location of php-files

Posted by lycanthrope 
help with location of php-files
December 12, 2019 11:03AM

I have some problems with php-files not loading, only the index.php loads properly which is located in the root of the www folder (wwwiki).

I wish to accomplish that the website loads as soon as i visit the server_name, how do I do that?
Currently Index.php loads if I enter it manually. If I visit it says "403 Forbidden"

In my index.php I have section where it should look for php files under the folder content/
If I load a php file in the browser it says "404 Not Found" (

<? php
$page="content/" . $section . ".php";
} else {


server {
server_name; # use domain name if you have here
access_log /var/log/nginx/;
error_log /var/log/nginx/;

root /wwwwiki;
# php config let nginx talk to php socket
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;

# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";

fastcgi_pass unix:/var/run/php72-fpm.sock;
fastcgi_index index.php;

# include the fastcgi_param setting
include fastcgi_params;

# SCRIPT_FILENAME parameter is used for PHP FPM determining
# the script name.
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

I guess I have to do something with location or add another section of location poiting to content/ ?

If I change the url I can see the content of the file but the css doesn't work.

I would appreciate some help :-)

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 198
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready