U
U
Umar Bezugov2021-11-07 17:29:00
open server
Umar Bezugov, 2021-11-07 17:29:00

Why is a 403 error shown in the browser when running php code from the open server?

So I installed OpenServer, created a php folder in the domains folder and put a php file inside it
In which
this code is written

<?php
echo *Hello*;
?>

Iiii launched openserver
Iiiiiiiiii showing this
6187e30cdd8e4643546767.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
Julia Lis, 2021-11-07
@julia1990

Check the owner and permissions of your file.

T
TheAndrey7, 2021-11-08
@TheAndrey7

Faced the same problem. Found the following solutions:
1. Edit the Apache config (I do not recommend). The desired config file is opened through the program menu.

<Directory "%ssitedir%/*">
    AllowOverride       All
    # Options           -FollowSymLinks +SymLinksIfOwnerMatch
    Options             -MultiViews +Indexes +FollowSymLinks +IncludesNoExec +Includes +ExecCGI
    Require             all granted
</Directory>

Here AllowOverride is set to none . Restart server.
2. The problem turned out to be in the incorrect definition of the root directory of the domain. Most likely, the program saw the public folder or another, considering it the root of the site. It was her listing of files that I saw when I made the change from the previous paragraph.
If you encounter this, in the program settings you need to manually specify the folder on the "domains" tab. In general, you need to create fictitious domains for your projects, instead of using localhost (cookies do not work on it).
https://ospanel.io/docs/#domeny-i-aliasy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question