【发布时间】:2018-02-22 03:09:51
【问题描述】:
我使用 Valet 在我的 MacBook 上开发基于 Laravel 的网站。现在我在家工作,我无法在工作中访问数据库,所以我尝试使用 Homebrew 安装 PHPMyAdmin,这样我就可以导入数据库转储并在本地工作。
我认为我的问题类似于这个问题:Installing phpmyadmin with home-brew 除了我使用的是 nginx。
安装后我确实得到了输出:
==> Installing phpmyadmin from homebrew/php
==> Downloading https://homebrew.bintray.com/bottles-php/phpmyadmin-4.7.4.sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/44/44d9e5789593f86499263496d6e901ecb9ce1b999e76ee4842268ef35d547c9f?__gda__=exp=1505301978~hmac=b16623e81ca8559fcd18e54c17dee0a6f42cfcd85892fd6f43f8f0dd14e4746c&response-content-disposition=
######################################################################## 100.0%
==> Pouring phpmyadmin-4.7.4.sierra.bottle.tar.gz
==> 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/opt/phpmyadmin/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.7.4: 2,345 files, 34.0MB
如何使用 nginx 启用对 phpmyadmin 的访问? http://localhost/phpmyadmin 返回 404
如果您需要更多信息,请告诉我。
【问题讨论】:
-
你更新了 nginx 配置了吗?你也跑
php-fpm了吗?看到这个coderwall.com/p/lbaf6q/… -
抱歉回复晚了。我认为我没有更新 nginx 配置。我尝试按照您链接到的文章中的步骤操作,但在
/usr/local/etc/php/7.1/php-fpm.conf中找不到listen行。 -
您需要在
/usr/local/etc/php/7.1/php-fpm.d/www.conf中进行编辑。默认使用127.0.0.1:9000。如果您具体使用套接字文件,那么您需要更改此文件,否则您可以在 nginx 配置中使用127.0.0.1:9000而不是套接字 -
嗯,好的。感谢那。我只是设法使用 Laravel Valet 让它工作,所以我不必为套接字等编辑任何东西。使用 Valet 我可以导航到
http://phpmyadmin.dev,它就像一个魅力。
标签: mysql nginx phpmyadmin