Have trouble installing phpmyadmin on PHP7 Apache/2.4.7 (Ubuntu)

后端 未结 6 1980
执笔经年
执笔经年 2020-12-05 00:18

I installed PHP7 today with

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-mysq         


        
相关标签:
6条回答
  • 2020-12-05 00:46

    I followed Magnus Eriksson's suggestion from comments

    Try to install the latest version manually by downloading phpmyadmin from their website. In all fairness, phpmyadmins apt-repo has dependencies to other packages in the official apt-repo. PHP7 doesn't exist in the apt-repo. (you added it manually, which phpmyadmins repo has no clue about).

    0 讨论(0)
  • 2020-12-05 00:52

    Using git clone of the original repo with a daily update cron job as documented here https://laracasts.com/discuss/channels/general-discussion/phpmyadmin-with-php7 worked really well for me. I put the following in my Vagrantfile (for a development server)

        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
    

    then added the alias as above

    Alias /phpmyadmin "/usr/share/phpmyadmin/"
    <Directory "/usr/share/phpmyadmin/">
         Order allow,deny
         Allow from all
         Require all granted
    </Directory>
    

    and

    service apache2 restart
    

    very easy, only a few steps, always up to date. (Ubuntu wily, php7)

    0 讨论(0)
  • 2020-12-05 00:53

    Install it via wget and create an alias in Apache. Keep track:

    Change to directory /usr/share:

    cd /usr/share
    

    Change to root user:

     sudo su
    

    Download phpMyAdmin:

    wget https://files.phpmyadmin.net/phpMyAdmin/4.5.4.1/phpMyAdmin-4.5.4.1-all-languages.zip
    

    Unzip it: (you may install unzip first)

    unzip phpMyAdmin-4.5.4.1-all-languages.zip
    

    Rename the folder:

    mv phpMyAdmin-4.5.4.1-all-languages phpmyadmin
    

    Change permissions:

    chmod -R 0755 phpmyadmin
    

    Configure apache so that it can find it correctly:

    vim /etc/apache2/sites-available/000-default.conf
    

    Anywhere after "DocumentRoot /var/www/html" insert these line:

    Alias /phpmyadmin "/usr/share/phpmyadmin/"
    <Directory "/usr/share/phpmyadmin/">
         Order allow,deny
         Allow from all
         Require all granted
    </Directory>
    

    Restart Apache:

    service apache2 restart
    

    And you are ready to go!

    Just took a screenshot from my current installation for you to validate it works.

    0 讨论(0)
  • 2020-12-05 00:53

    phpMyAdmin depends on the extension mbstring.

    For Debian users (tested in Ubuntu 15.10),

     sudo apt-get install php7.0-mbstring
    

    For Fedora and CentOS,

    sudo yum install php70w-mbstring
    
    0 讨论(0)
  • 2020-12-05 00:54

    CentOS 7.2, PHP 7, PhpMyadmin 4.6.4

    Step 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
    

    Step 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>
    

    Step 3:

    systemctl restart httpd
    

    Step 4: i Cake http://www.example.com/phpmyadmin

    0 讨论(0)
  • 2020-12-05 01:05

    Before installing PHP 7 you should backup your database. During the installation process, you will delete your old version of php and be asked if you want to delete your database. Don't do it unless you really want to get rid of it.

    Download phpmyadmin from https://www.phpmyadmin.net/ and uncompress it and move the folder to one level below the document root folder. It then worked for me when I navigated to it with localhost without further setup. I had to erase my bookmarks to phpmyadmin and make new bookmarks for the new location. My old database was fine.

    I would like to install phpmyadmin globally so it could be installed or reinstalled or updated by apt-get, but don't know how.

    0 讨论(0)
提交回复
热议问题