首页 > 编程语言 >Apache 2 & PHP 8 errors All In One

Apache 2 & PHP 8 errors All In One

时间:2022-12-13 17:24:14浏览次数:71  
标签:httpd www errors http Apache PHP com webhacker php

Apache 2 & PHP 8 errors All In One

errors

You don‘t have permission to access this resource.

http://www.webhacker.com/phpinfo.php

http://www.webhacker.com/

solutions

✅ 1. 修改 httpd.conf 配置文件, 把 "Require all denied" 修改成 Require all granted

/usr/local/etc/httpd/httpd.conf

#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other 
# <Directory> blocks below.
#
<Directory />
    AllowOverride none
    # Require all denied
    Require all granted
</Directory>

✅ 2. 修改 httpd-vhosts.conf 配置文件, 新增 <Directory /> 配置,并开启 Require all granted

/usr/local/etc/httpd/extra/httpd-vhosts.conf

## PHP 8.1
<VirtualHost *:80>
    ServerAdmin [email protected]
    # DocumentRoot "/Library/WebServer/Documents"
    # DocumentRoot "/usr/local/var/www"
    DocumentRoot "/usr/local/var/php8"
    # DocumentRoot "/usr/local/opt/httpd/docs/php8"
    # DocumentRoot "/usr/local/opt/httpd/docs/www.webhacker.com"
    <Directory />
        AllowOverride none
        # Require all denied
        Require all granted
    </Directory>
    ServerName webhacker.com
    ServerAlias www.webhacker.com
    ErrorLog "/usr/local/var/log/httpd/www.webhacker.com-error_log"
    CustomLog "/usr/local/var/log/httpd/www.webhacker.com-access_log" common
</VirtualHost>

demos

http://localhost/phpinfo.php

http://localhost:80/phpinfo.php

http://www.webhacker.com/phpinfo.php

Apache Environment

自定义 hosts 域名

test

image

http://localhost/xss.php?args=<script>alert("XSS

标签:httpd,www,errors,http,Apache,PHP,com,webhacker,php
From: https://www.cnblogs.com/xgqfrms/p/16978984.html

相关文章