[SOLVED]Install phpmyadmin for laravel 5.2
I have tried to install phpmyadmin for laravel5.2, using apt-get, but after installation when I type localhost/phpmyadmin , It says page not found. How can the installation be done ?
I currently have a symlink setup in my public folder that points to /usr/share/phpmyadmin. Seems to work fine.
I got this problem before while installing phpmyadmin .. You have to create a link to your localhost folder for phpmyadmin
Which version of Ubuntu you are using?
Type this command in terminal :
sudo ln -s /usr/share/phpmyadmin /var/www/
For Ubuntu version >=14.04
sudo ln -s /usr/share/phpmyadmin /var/www/html/
Correct way is to include the phpmyadmin config file. Edit the apache2.conf file and add to the end of the file:
Include /etc/phpmyadmin/apache.conf
If you're using homestead this is my solution (one phpmyadmin installation for all projects).
- Download/Clone phpMyAdmin somewhere (let's say
/workspace/phpmyadmin) - Add it as shared folder to Homestead.yaml
- Add the site to Homestead.yaml
Homestead.yaml (Example)
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: laravel-project
name: laravel-project
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: "/workspace/laravel-project"
to: "/home/vagrant/laravel-project"
- map: "/workspace/phpmyadmin"
to: "/home/vagrant/phpmyadmin"
sites:
- map: homestead.app
to: "/home/vagrant/laravel-project/public"
- map: phpmyadmin.homestead.app
to: "/home/vagrant/phpmyadmin"
databases:
- homestead
You can access your laravel installations at http://homestead.app and phpmyadmin at http://phpmyadmin.homestead.app .
Don't forget to map both domains to the virtual machine ip address in your /etc/hosts file.
phpmyadmin is not part of laravel. What are you using for your php/apache implementation? install it.
Manuals are a wonderful thing!
@jimmck as local server, I'm using laravel artisan serve, their inbuilt server. How is it different from using apache ?
I think you can use the php built in server to run phpmyadmin. Open another terminal window and run the server from phpmyadmin directory (remember to change the port so it's not the same as artisan serve).
If it doesn't work, then you might have to consider switch to another database browser tool or install apache/nginx (I would prefer the latter).
@TheNodi Thank you for the suggestion, I have shifted to apache, but I am having issue with getting apache to work with laravel. What I have done is, got a copy of laravel project in /var/www/html/ . When I do sudo service apache2 start, on the browser I get apache's page (ie its index.php), but I am not able to get laravel's homepage. Also when I go to localhost/phpmyadmin, I get a blank page.
You should add an apache VirtualHost which points to the Laravel's public folder.
This article explains it: Laravel Recieps- Creating an Apache VirtualHost
I don't remember how phpmyadmin package installs itselft, in theory if you've installed it after apache it should have created a VirtualHost to his folder. Check the apache configurations file to look for a phpmyadmin file, it should be something like phpmyadmin.conf. Might also be in /etc/phpmyadmin/..somewhere-something.conf. (I don't have a machine to check it right now)
These are the steps I followed: Configuring phpmyadmin for laravel 5.2 (without homestead) was getting difficult, so I opted for apache webserver to be used as server instead of in build php artisan serve. I installed apache followed it by phpmyadmin, and mapping of the host server page to laravel's page was done as explained here : Laravel Recieps- Creating an Apache VirtualHost . Thank you @TheNodi for your help.
If you are using an apache server and ubuntu you can follow the steps below
First you need to create a link
sudo ln -s /usr/share/phpmyadmin /var/www/
Then you need to edit the apache conf file to include phpmyadmin apache.conf
sudo nano /etc/apache2/apache2.conf
add the following line to the apache2.conf file
Include /etc/phpmyadmin/apache.conf
Use the following commands to activate it
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
sudo a2enconf phpmyadmin.conf
and finally reload the server
sudo service apache2 reload
now you will be able to access the domain/phpmyadmin
@TheNodi I had a nightmare trying to setup phpmyadmin into the local server on my mac. Your solution for homestead worked perfectly. From now on I will use homestead for everything:) Just one question: How can we update phpmyadmin? Should I from time to time download a new version manually or is there a method that automatically updates the contents of that folder?
@viery364
I just clone the phpmyadmin STABLE branch from github and run a git pull from time to time. Probably there're better ways but I don't need to keep it super up-to-date.
Please or to participate in this conversation.