我尝试使用home-brew安装和配置phpmyadmin。要安装,我使用了命令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
我按照终端输出的说明进行操作,尽管如此,当我输入url http://localhost/phpmyadmin进入safari时,我仍然会收到错误消息Safari can't open the page "localhost/phpmyadmin" because Safari can't connect to the server "localhost"
。我认为我可能已经在phpmyadmin.config.in.php文件中正确设置了cookie配置,但不知道如何纠正这个问题。
答案 0 :(得分:7)
我发现说明不完整,你还必须:
删除&#39;#&#39;在/etc/apache2/httpd.conf开头注释LoadModule php5_module:
LoadModule php5_module libexec/apache2/libphp5.so
将/etc/apache2/httpd.conf中的DirectoryIndex设置编辑为:
DirectoryIndex index.php index.html home.pl index.cgi
保存文件......
在终端应用程序中启动Apache Webserver:
sudo apachectl start
如果它已经启动,它会显示一条消息:&#34;服务已加载&#34;,在这种情况下运行:
sudo apachectl restart
多次刷新页面(可能是先前的状态已缓存或服务尚未启动..)
答案 1 :(得分:4)
我认为您错过了balazs630解释的第一部分。这是相同的:
==> 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>
最后,检查DirectoryIndex是否包含index.php DirectoryIndex index.php index.html
可以在以下位置找到php.ini和php-fpm.ini文件: /usr/local/etc/php/7.4 /
要立即启动php并在登录时重新启动: 酿造服务启动PHP 或者,如果您不希望/不需要后台服务,则可以运行: php-fpm
==> 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>