[英]Installing phpmyadmin with home-brew
I have tried to install and configure phpmyadmin using home-brew.我尝试使用 home-brew 安装和配置 phpmyadmin。 To install I used the commands
brew install phpmyadmin
and this is the summary of the message printed in the terminal.为了安装,我使用了命令
brew install phpmyadmin
,这是终端中打印的消息的摘要。
==> Summary
🍺 /usr/local/Cellar/php71/7.1.0-beta.1: 342 files, 50.3M, built in 7 minutes 29 seconds
==> Installing homebrew/php/phpmyadmin
==> Downloading https://github.com/phpmyadmin/phpmyadmin/archive/RELEASE_4_6_2.t
==> Downloading from https://codeload.github.com/phpmyadmin/phpmyadmin/tar.gz/RE
######################################################################## 100.0%
==> Caveats
Note that this formula will NOT install mysql. It is not
required since you might want to get connected to a remote
database server.
Webserver configuration example (add this at the end of
your /etc/apache2/httpd.conf for instance) :
Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
Then, open http://localhost/phpmyadmin
More documentation : file:///usr/local/Cellar/phpmyadmin/4.6.2/share/phpmyadmin/doc/
Configuration has been copied to /usr/local/etc/phpmyadmin.config.inc.php
Don't forget to:
- change your secret blowfish
- uncomment the configuration lines (pma, pmapass ...)
==> Summary
🍺 /usr/local/Cellar/phpmyadmin/4.6.2: 2,256 files, 63.2M, built in 39 seconds
I followed the instruction at the terminal output, despite this when I type into the url http://localhost/phpmyadmin into safari I still end up with the error message, Safari can't open the page "localhost/phpmyadmin" because Safari can't connect to the server "localhost"
.我按照终端输出中的说明进行操作,尽管如此,当我在 safari 中输入 url http://localhost/phpmyadmin 时,我仍然收到错误消息,
Safari can't open the page "localhost/phpmyadmin" because Safari can't connect to the server "localhost"
。 I think it's possible that I have set the cookie configuration correctly in the phpmyadmin.config.in.php file but not sure how I can correct this.我认为我可能在 phpmyadmin.config.in.php 文件中正确设置了 cookie 配置,但不确定如何更正。
I found that the instructions are not complete, you also have to:我发现说明不完整,您还必须:
Remove the '#' comment at the beginning in /etc/apache2/httpd.conf for LoadModule php5_module:删除 /etc/apache2/httpd.conf 中 LoadModule php5_module 开头的“#”注释:
LoadModule php5_module libexec/apache2/libphp5.so
Edit the DirectoryIndex settings in /etc/apache2/httpd.conf to:将 /etc/apache2/httpd.conf 中的 DirectoryIndex 设置编辑为:
DirectoryIndex index.php index.html home.pl index.cgi
Save the file...保存文件...
Start Apache Webserver in Terminal application:在终端应用程序中启动 Apache Webserver:
sudo apachectl start
If it's already started, it will show you a message: "service already loaded", in this case run:如果它已经启动,它会显示一条消息:“服务已经加载”,在这种情况下运行:
sudo apachectl restart
Go to http://localhost/phpmyadmin转到http://localhost/phpmyadmin
Wait for a bit then refresh the page several times (maybe a previous state was cached or the service is not started yet..)稍等片刻,然后多次刷新页面(可能之前的状态已被缓存或服务尚未启动......)
I think you missed the first part as explained by balazs630.. here is the same:我想你错过了 balazs630 解释的第一部分..这里是一样的:
==> php To enable PHP in Apache add the following to httpd.conf and restart Apache: LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so ==> php 要在 Apache 中启用 PHP,请将以下内容添加到 httpd.conf 并重新启动 Apache: LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
Finally, check DirectoryIndex includes index.php DirectoryIndex index.php index.html最后,检查 DirectoryIndex 包括 index.php DirectoryIndex index.php index.html
The php.ini and php-fpm.ini file can be found in: /usr/local/etc/php/7.4/ php.ini 和 php-fpm.ini 文件位于:/usr/local/etc/php/7.4/
To have launchd start php now and restart at login: brew services start php Or, if you don't want/need a background service you can just run: php-fpm现在启动 php 并在登录时重新启动: brew services start php 或者,如果您不想要/不需要后台服务,您可以运行: php-fpm
==> phpmyadmin To enable phpMyAdmin in Apache, add the following to httpd.conf and restart Apache: ==> phpmyadmin 要在 Apache 中启用 phpMyAdmin,请将以下内容添加到 httpd.conf 并重新启动 Apache:
Alias /phpmyadmin /usr/local/share/phpmyadmin
<Directory /usr/local/share/phpmyadmin/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
</Directory>
Then open http://localhost/phpmyadmin然后打开http://localhost/phpmyadmin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.