我今天用安装了PHP7
sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get install php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm
此后,当我尝试访问phpmyadmin时出现403禁止错误。然后我尝试用重新安装phpmyadmin
apt-get install phpmyadmin
但它仍在查找不再存在的php5依赖项:
我该怎么解决?
通过wget安装它并在Apache中创建一个别名。跟踪:
转到目录/ usr / share:
cd /usr/share
更改为root用户:
sudo su
下载phpMyAdmin:
wget https://files.phpmyadmin.net/phpMyAdmin/4.5.4.1/phpMyAdmin-4.5.4.1-all-languages.zip
解压缩:(您可以先安装解压缩)
unzip phpMyAdmin-4.5.4.1-all-languages.zip
重命名文件夹:
mv phpMyAdmin-4.5.4.1-all-languages phpmyadmin
更改权限:
chmod -R 0755 phpmyadmin
配置apache,以便它可以正确找到它:
vim /etc/apache2/sites-available/000-default.conf
在“ DocumentRoot / var / www / html ”之后的任意位置插入以下行:
Alias /phpmyadmin "/usr/share/phpmyadmin/"
<Directory "/usr/share/phpmyadmin/">
Order allow,deny
Allow from all
Require all granted
</Directory>
重新启动Apache:
service apache2 restart
您已经准备好出发了!
刚刚从我当前的安装中截取了一张屏幕截图,以供您验证它是否有效。
phpMyAdmin取决于扩展名mbstring。
对于Debian用户(已在Ubuntu 15.10中测试),
sudo apt-get install php7.0-mbstring
对于Fedora和CentOS,
sudo yum install php70w-mbstring
如https://laracasts.com/discuss/channels/general-discussion/phpmyadmin-with-php7所述,将原始回购的git clone与每日更新cron作业配合使用对我来说确实很好。我将以下内容放入我的Vagrantfile中(用于开发服务器)
if [ ! -d /usr/share/phpmyadmin ]; then
sudo mkdir /usr/share/phpmyadmin
sudo git clone --depth=1 --branch=STABLE https://github.com/phpmyadmin/phpmyadmin.git /usr/share/phpmyadmin
fi
然后添加别名如上
Alias /phpmyadmin "/usr/share/phpmyadmin/"
<Directory "/usr/share/phpmyadmin/">
Order allow,deny
Allow from all
Require all granted
</Directory>
和
service apache2 restart
非常简单,只需几个步骤,始终保持最新状态。(Ubuntu wily,php7)
在安装PHP 7之前,您应该备份数据库。在安装过程中,您将删除旧版本的php,并询问您是否要删除数据库。除非您真的想摆脱它,否则不要这样做。
从https://www.phpmyadmin.net/下载phpmyadmin并将其解压缩,然后将文件夹移至文档根文件夹下的一级。然后,当我使用localhost导航到它而无需进一步设置时,它对我有用。我必须将我的书签删除到phpmyadmin并为新位置创建新书签。我的旧数据库很好。
我想在全球范围内安装phpmyadmin,以便可以通过apt-get进行安装,重新安装或更新,但不知道如何进行。
我从评论中遵循了Magnus Eriksson的建议
通过从其网站下载phpmyadmin尝试手动安装最新版本。公平地说,phpmyadmins apt-repo对官方apt-repo中的其他软件包有依赖性。apt-repo中不存在PHP7。(您手动添加了它,而phpmyadmins仓库对此一无所知)。
CentOS 7.2,PHP 7,PhpMyadmin 4.6.4
第1步:
$ cd /usr/share
$ wget https://files.phpmyadmin.net/phpMyAdmin/4.6.4/phpMyAdmin-4.6.4-all-languages.zip
$ unzip phpMyAdmin-4.6.4-all-languages.zip
$ mv phpMyAdmin-4.6.4-all-languages phpmyadmin
第2步:
$ cd /etc/httpd/conf.d
$ touch phpmyadmin.conf
$ put on phpmyadmin.conf following content
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 217.x.x.x
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 217.x.x.x
Allow from ::1
</IfModule>
</Directory>
<Directory /usr/share/phpmyadmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
<Directory /usr/share/phpmyadmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
<Directory /usr/share/phpmyadmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>
第三步:
systemctl restart httpd
第4步:我蛋糕http://www.example.com/phpmyadmin
文章标签:php , php-7 , phpmyadmin
版权声明:本文为原创文章,版权归 admin 所有,欢迎分享本文,转载请保留出处!
评论已关闭!