Welcome! Log In Create A New Profile

Advanced

help with location of php-files

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

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 192.168.30.11 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" (192.168.30.11/somefile.php)

Index.php
<? php
if(strlen($pageTitles[$section])>0)
{
$page="content/" . $section . ".php";
} else {
$page="content/404-error.php";
}
?>


/usr/local/etc/nginx/nginx.conf

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

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 192.168.30.11/content/something.php I can see the content of the file but the css doesn't work.

I would appreciate some help :-)

Thaaaaaaanks
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 197
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