首页 > 编程语言 >macOS 13 install PHP 8 and Apache config Apache Virtual Host All In One

macOS 13 install PHP 8 and Apache config Apache Virtual Host All In One

时间:2022-12-10 21:22:51浏览次数:81  
标签:httpd macOS local 13 usr www Apache com

macOS 13 install PHP 8 and Apache config Apache Virtual Host All In One

目的:搭建本地 PHP 网站用于对 XSS / CSRF 等 Web 攻击安全问题进行验证

macOS 13 & PHP 8.x

# PHP was deprecated in macOS 11 and removed from macOS 12
$ brew install php

# PHP 8.1.13
$ php -v
PHP 8.1.13 (cli) (built: Nov 24 2022 20:36:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies


https://formulae.brew.sh/formula/php#default

PHP 8.2

https://www.php.net/

Apache & PHP

# Apache 2
$ apachectl -v
Server version: Apache/2.4.54 (Unix)
Server built:   Sep 30 2022 02:51:01


$ sudo apachectl start

$ sudo apachectl stop

$ sudo apachectl restart

error

macOS 系统自带的 Apache 配置 PHP 后,会出现无法访问问题 ❌ (macOS 不支持 PHP 了,配置了会导致服务器报错)

标签:httpd,macOS,local,13,usr,www,Apache,com
From: https://www.cnblogs.com/xgqfrms/p/16972365.html

相关文章