search
HomeDatabasephpMyAdminDetailed graphic explanation on how to install phpmyadmin on Macbook M1

The following column phpmyadmin tutorial will introduce to you how to install phpmyadmin on Macbook M1. There are pictures to explain the steps~ I hope it will be helpful to friends in need!

Explanation

Many tutorials on the Internet feel like they are half-covered with Pipa. Since you want to share, you have to make it clear and post more pictures. Really, it causes I stepped on the pit like crazy. Fortunately, I figured it out in the end, so let me post a related tutorial. First of all, Macbook does have built-in apache

Enable the apache service through

apachectl start

You can enter localhost in the browser and see the result

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

It works! is correct. But for PHP, it was built-in from macOS

#Install phpDetailed graphic explanation on how to install phpmyadmin on Macbook M1

brew installation

It is recommended to use brew installation

brew update # 不进行这一步我出现了missing bottle的错误brew install php@7.4

Then you will see

That is, directly tell you how to configure apache and nginx, set them as global commands, and start them. Detailed graphic explanation on how to install phpmyadmin on Macbook M1

Configure in apache

打开apache的配置文件
cd /etc/apache2
sudo cp httpd.conf.bak #备份一下,防止修改文件出错
sudo chmod 666 httpd.conf #修改文件的权限,免得无法修改
# 可以通过 ls -l httpd.conf查看文件的权限
# -rw-r--r-- 初始权限,一般我们用户下是没有写权限的
vim httpd.conf #使用vim编辑
/LoadModule p   #定位在此,所有的LoadModule xxx都是按字母排序的,不要轻易打乱
i #启动插入编辑

Join

LoadModule php7_module /opt/homebrew/opt/php@7.4/lib/httpd/modules/libphp7.so

    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Change

to Detailed graphic explanation on how to install phpmyadmin on Macbook M1

Add a line in Detailed graphic explanation on how to install phpmyadmin on Macbook M1

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

AddType application/x-httpd-php .php
Verify whether the configuration file is correct

apachectl -t
Syntax Ok appears and is successful .

Modify PHP configuration file

cd /opt/homebrew/etc/php/7.4
ls -l php.ini. #先检查权限,没有写全县则使用chmod
Configuration of environment variables

echo &#39;export PATH="/opt/homebrew/opt/php@7.4/bin:$PATH"&#39; >> ~/.zshrc
echo &#39;export PATH="/opt/homebrew/opt/php@7.4/sbin:$PATH"&#39; >> ~/.zshrc
echo &#39;export LDFLAGS="-L/opt/homebrew/opt/php@7.4/lib"&#39; >> ~/.zshrc
echo &#39;export CPPFLAGS="-I/opt/homebrew/opt/php@7.4/include"&#39; >> ~/.zshrc
source ~/.zshrc #重新加载环境变量

Start php

brew services restart php@7.4

View apache server Has phpDetailed graphic explanation on how to install phpmyadmin on Macbook M1

apachectl -M
sudo apachectl -k restart # 记得重启

been loaded successfully? ! ! Detailed graphic explanation on how to install phpmyadmin on Macbook M1

Tested index.php file

In Finder

command

shift G, switch the path to /Library/WebServer

Open the introduction of the Documents folderDetailed graphic explanation on how to install phpmyadmin on Macbook M1

Click the lock to unlock Join the current user and give read and write permissionsDetailed graphic explanation on how to install phpmyadmin on Macbook M1

In the Documents folder, create a new index.php file (I write it in VSCode anyway)Detailed graphic explanation on how to install phpmyadmin on Macbook M1

<?php     phpinfo();?>
Verification

Open the browser and enter

http://localhost/index.php

You’re done! ! ! (PS: It took me more than four hours to get to this point, it’s too difficult) Detailed graphic explanation on how to install phpmyadmin on Macbook M1

Install phpmyadmin

Official website download compressed package

Address

cd /Users/zerotower/Documents
tar -zvxf xxx #你下载的压缩包
cp -rf /Users/zerotower/Downloads/phpMyAdmin-5.1.3-all-languages /Library/WebServer/Documents/phpmyadmin #把解压的文件放入apache服务器网站目录下
cd /Library/WebServer/Documents/phpmyadmin #进入服务器下的phpmyadmin目录
cp config.sample.inc.php config.inc.php #使用样例配置文件创建配置文件
vim config.inc.php

/blowfish
Modify the configuration and fill in the password as you like

# then enter in the browserDetailed graphic explanation on how to install phpmyadmin on Macbook M1http://localhost/phpmyadmin/index.php

Just enter your database account password and you’re done! ! ! Detailed graphic explanation on how to install phpmyadmin on Macbook M1

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

完结散花!!

遇到的问题

证书签名的问题

安装php中,会出现

Detailed graphic explanation on how to install phpmyadmin on Macbook M1据说是证书验证的问题command+space搜索钥匙串访问

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

点进去进入到创建证书

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

创建一张代码签名证书。

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

证书始终信任

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

# 对php这个链接库进行签名
sudo codesign --sign "ztCA" --force --keychain  ~/Library/Keychains/login.keychain-db /opt/homebrew/opt/php@7.4/lib/httpd/modules/libphp7.so

修改httpd.conf 在原来的

LoadModule php7_module /opt/homebrew/opt/php@7.4/lib/httpd/modules/libphp7.so

改为

LoadModule php7_module /opt/homebrew/opt/php@7.4/lib/httpd/modules/libphp7.so "ztCA"

然后验证修改是否正确

apachectl -t

出现

Detailed graphic explanation on how to install phpmyadmin on Macbook M1

问题解决。

The above is the detailed content of Detailed graphic explanation on how to install phpmyadmin on Macbook M1. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:juejin. If there is any infringement, please contact admin@php.cn delete
phpmyadmin怎么设置主键phpmyadmin怎么设置主键Apr 07, 2024 pm 02:54 PM

表的主键是一列或多列,用于唯一标识表中每条记录。设置主键的步骤如下:登录 phpMyAdmin。选择数据库和表。勾选要作为主键的列。点击 "保存更改"。主键具有数据完整性、查找速度和关系建模方面的好处。

phpmyadmin怎么添加外键phpmyadmin怎么添加外键Apr 07, 2024 pm 02:36 PM

在 phpMyAdmin 中添加外键可以通过以下步骤实现:选择包含外键的父表。编辑父表结构,在“列”中添加新列。启用外键约束,选择引用表和键。设置更新/删除操作。保存更改。

phpmyadmin账号密码是什么phpmyadmin账号密码是什么Apr 07, 2024 pm 01:09 PM

PHPMyAdmin 的默认用户名和密码为 root 和空。为了安全起见,建议更改默认密码。更改密码的方法:1. 登录 PHPMyAdmin;2. 选择 "privileges";3. 输入新密码并保存。忘记密码时,可通过停止 MySQL 服务并编辑配置文件的方式重置密码:1. 添加 skip-grant-tables 行;2. 登录 MySQL 命令行并重置 root 密码;3. 刷新权限表;4. 删除 skip-grant-tables 行,重启 MySQL 服务。

phpmyadmin日志在哪里phpmyadmin日志在哪里Apr 07, 2024 pm 12:57 PM

PHPMyAdmin日志文件的默认位置:Linux/Unix/macOS:/var/log/phpmyadminWindows:C:\xampp\phpMyAdmin\logs\日志文件用途:故障排除审计安全性

phpmyadmin怎么删除数据表phpmyadmin怎么删除数据表Apr 07, 2024 pm 03:00 PM

phpMyAdmin 中删除数据表的步骤:选择数据库和数据表;点击“操作”选项卡;选择“删除”选项;确认并执行删除操作。

为什么phpmyadmin拒绝访问为什么phpmyadmin拒绝访问Apr 07, 2024 pm 01:03 PM

phpMyAdmin 拒绝访问的原因及解决方案:认证失败:检查用户名和密码是否正确。服务器配置错误:调整防火墙设置,检查数据库端口是否正确。权限问题:授予用户对数据库的访问权限。会话超时:刷新浏览器页面重新连接。phpMyAdmin 配置错误:检查配置文件和文件权限,确保启用了必需的 Apache 模块。服务器问题:等待一段时间后再重试或联系主机提供商。

phpmyadmin漏洞属于什么漏洞phpmyadmin漏洞属于什么漏洞Apr 07, 2024 pm 01:36 PM

phpMyAdmin 易受多种漏洞影响,包括:1. SQL 注入漏洞;2. 跨站点脚本 (XSS) 漏洞;3. 远程代码执行 (RCE) 漏洞;4. 本地文件包含 (LFI) 漏洞;5. 信息泄露漏洞;6. 权限提升漏洞。

phpmyadmin关联视图在哪phpmyadmin关联视图在哪Apr 07, 2024 pm 01:00 PM

可以在 phpMyAdmin 中“结构”选项卡下的“视图”子菜单中找到关联视图。要访问它们,只需选择数据库、点击“结构”选项卡、然后点击“视图”子菜单。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.